Issue #1991 - Support TURN TLS Support in WebRTC Backport of Mozilla bug 1056934

This commit is contained in:
Basilisk-Dev 2022-08-20 14:21:43 -04:00 • committed by roytam1
commit 2dc4713d14
16 changed files with 282 additions and 26 deletions

View file

@ -666,6 +666,14 @@ static int nr_ice_candidate_resolved_cb(void *cb_arg, nr_transport_addr *addr)
if(r=nr_transport_addr_copy(&cand->stun_server_addr,addr))
ABORT(r);
if (cand->stun_server->tls) {
/* Copy over the DNS name; needed for TLS. There is already a null at the
* end of the buffer, leave it there. */
strncpy(cand->stun_server_addr.tls_host,
cand->stun_server->u.dnsname.host,
sizeof(cand->stun_server_addr.tls_host) - 1);
}
if (cand->tcp_type == TCP_TYPE_PASSIVE || cand->tcp_type == TCP_TYPE_SO){
if (r=nr_socket_multi_tcp_stun_server_connect(cand->osock, addr))
ABORT(r);

View file

@ -63,6 +63,7 @@ typedef struct nr_ice_stun_server_ {
} u;
int id;
int transport;
int tls; /* Whether to use TLS or not */
} nr_ice_stun_server;
typedef struct nr_ice_turn_server_ {

View file

@ -66,6 +66,7 @@ typedef struct nr_transport_addr_ {
/* A string version.
56 = 5 ("IP6:[") + 39 (ipv6 address) + 2 ("]:") + 5 (port) + 4 (/UDP) + 1 (null) */
char as_string[56];
char tls_host[256];
} nr_transport_addr;
typedef struct nr_transport_addr_mask_ {