Application + Implementation overview
In out application we need to performig video recording. We went ahead with MediaRecorder API hosted at https://developer.mozilla.org/en/docs/Web/API/MediaRecorder_API.
We are getUserMedia API to access webCam and mic. We are using MediaRecorder API to record short blobs and sending it on application server hosting NodeJS WebSocket. ( Data transmission in short blobs to server is happening in every 2 second.
On app server we keep on accumulating data and finally create a .webm media file.
Issue: All this is working fine with HTTP protocol, but whenever we put application on SSL and starts erring with below description;
Error Text: "WebSocket connection to 'wss://localhost:9000/' failed: WebSocket opening handshake was canceled"
Error screenshot: http://s33.postimg.org/9xasw0qa7/web_Socket_SSLIssue.jpg
Can any of you guide us with whats the issue specifically with HTTPS here.
Browsers will reject self-signed certificates for WebSocket connections as they consider them as unsafe. You can make a valid free certificate using letsencrypt but you need frist edit and add face domain to hosts file.
If you use Windows press win key and past notepad %systemroot%\system32\drivers\etc\hosts and right click use Run as Administator and add fake domain and save
Now you need to set new SSL with nodejs with new certification for more detail. https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener
For testing you use a fake domain instead of localhost etc. wss://fakedomain.com:9000