diff options
author | Jørgen H <asterisk.org@hovland.cx> | 2017-02-16 10:22:47 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2017-03-01 09:53:18 -0600 |
commit | 7922f26cb0377b0d36ead20178bf1d3bf06db784 (patch) | |
tree | 9d39da2134783b6c6bab3b248b8427fd91bb31d9 /res/res_pjsip/security_events.c | |
parent | 26bf1846e2d436ffec1867351f25e5bcd43139c6 (diff) |
res_pjsip WebRTC/websockets: Fix usage of WS vs WSS.
According to the RFC[1] WSS should only be used in the Via header
for secure Websockets.
* Use WSS in Via for secure transport.
* Only register one transport with the WS name because it would be
ambiguous. Outgoing requests may try to find the transport by name and
pjproject only finds the first one registered. This may mess up unsecure
websockets but the impact should be minimal. Firefox and Chrome do not
support anything other than secure websockets anymore.
* Added and updated some debug messages concerning websockets.
* security_events.c: Relax case restriction when determining security
transport type.
* The res_pjsip_nat module has been updated to not touch the transport
on Websocket originating messages.
[1] https://tools.ietf.org/html/rfc7118
ASTERISK-26796 #close
Change-Id: Ie3a0fb1a41101a4c1e49d875a8aa87b189e7ab12
Diffstat (limited to 'res/res_pjsip/security_events.c')
-rw-r--r-- | res/res_pjsip/security_events.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/res/res_pjsip/security_events.c b/res/res_pjsip/security_events.c index b8a8d5212..ea3810bfd 100644 --- a/res/res_pjsip/security_events.c +++ b/res/res_pjsip/security_events.c @@ -42,9 +42,9 @@ static enum ast_transport security_event_get_transport(pjsip_rx_data *rdata) } else if (rdata->tp_info.transport->key.type == PJSIP_TRANSPORT_TLS || rdata->tp_info.transport->key.type == PJSIP_TRANSPORT_TLS6) { return AST_TRANSPORT_TLS; - } else if (!strcmp(rdata->tp_info.transport->type_name, "WS")) { + } else if (!strcasecmp(rdata->tp_info.transport->type_name, "WS")) { return AST_TRANSPORT_WS; - } else if (!strcmp(rdata->tp_info.transport->type_name, "WSS")) { + } else if (!strcasecmp(rdata->tp_info.transport->type_name, "WSS")) { return AST_TRANSPORT_WSS; } else { return 0; |