WSS connection error : ERR_SSL_PROTOCOL_ERROR

854 views
Skip to first unread message

hakimu junglu

unread,
Jan 5, 2017, 5:49:02 AM1/5/17
to meetecho-janus
Hi, 

Lately i was trying to secure the websocket connection between the client and the Janus server. 
Even tho i am aware that it is better to not go WSS on janus because a bug can occur and multiply the server consumption it would appreciable to be possible to use this feature. 

My front-end is a python simple https server that serves the Demo folder. I modified the videoroomtest.js file to try to connect in wss if the window is on https as follow :  

if(window.location.protocol === 'https:')
    var server = [
        "wss://" + window.location.hostname + ":8989"];

I also changed the cfg file for the videoroom and started up the wss server on the 8989 port.

The problem is that on either Chrome or Firefox (in private window mode), i got the following error : 
ERR_SSL_PROTOCOL_ERROR

I uninstalled both FireFox and Chrome and re installed them, i did the same with Openssl, libssl as well as  libcrypto and got all the latest versions but nothing changed. 

The WSS error i get is the 1006 wich is very very opaque and only mean that the connection failed unexpectedly (from what i understood).  

I fetched on the internet but i didn t found any relevant answer or clue, so if by any chance someone got a clue or maybe already encountered this error and managed to fix it, it will be great help.  

Thank you for Janus, have a nice day :) .

Lorenzo Miniero

unread,
Jan 5, 2017, 6:01:23 AM1/5/17
to meetecho-janus
The server consumption bug is for the HTTP support via MHD, not WebSockets. Anyway, the problem you're experiencing is very likely caused by the usage of self signed certificates or things like that. Browsers won't automatically accept it, and they don't expose a programmatic way to do that. The easiest way to overcome that is proxying WebSockets requests via HTTPD or nginx in a secure way and use the same certificate for both HTTPS and WSS, and use plain websockets with Janus itself. This way, even if you're using self signed certificates, the user will already have accepted it when joining the HTTPS website, which means it will be valid when WSS is used.

L.

hakimu junglu

unread,
Jan 5, 2017, 8:58:09 AM1/5/17
to meetecho-janus
You were right i changed my certificates for authority signed ones and everything is working flawlessly.

The proxy technique is working well too.

Thank you have a great day :).
Reply all
Reply to author
Forward
0 new messages