conncheck: fix try-alternate on tcp turn sockets
authorFabrice Bellet <fabrice@bellet.info>
Sun, 3 May 2020 15:39:09 +0000 (17:39 +0200)
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>
Fri, 8 May 2020 19:34:12 +0000 (19:34 +0000)
commit1bfac4963b205e58d5fd5d9fde56b365ff4177cd
tree7b050464f4a13831001f8d3538844dd5e52ee393
parentf974224ecede2898386d2959b6c4a8510c044251
conncheck: fix try-alternate on tcp turn sockets

In OC2007R2 compatibility mode, we observed the behaviour of a skype
turn server, when returning code 300 (try-alternate) stun error on its
tls connections. This value is returned apparently when the turn server
is overloaded already.

We noticed that the actual code in priv_handle_turn_alternate_server()
cannot handle a non-udp turn server, because a tcp one would require
to create a new socket.

But, even when creating such a new socket stack (tcp-bsd socket +
pseudossl socket), libnice still fails to establish a new connection to
the alternate server on port 443, in a very systematic way. I'm not sure
whether this problem is specific to this skype server infrastructure
(the skype client fails in a similar way). Anyway, this code path works
as expected with a non-microsoft turn server (tested with coturn).
agent/conncheck.c