I get the following error when trying to establish a secure WebSocket connection over SSL:
WebSocket connection to 'wss://...' failed: Error in connection establishment: net::ERR_INSECURE_RESPONSE
Where ‘…’ is the address of my socket server. My code for initializing the secure WebSocket is:
var socket = new WebSocket('wss://...');
Some things to note:
-
I am able to make a connection with a non-secure WebSocket just fine
-
This same secure WebSocket works 100% perfectly in ionic 1.x projects just fine: This is only an issue for my latest ionic 2 projects
-
My build is targeting a desktop browser app using
ionic build browser --prodwhere it is being hosted from an SSL domain, and where the domain’s certificate is trusted as valid by the browser (Chrome Version 57, macOS 10.12.4 )
I’ve tried adding a Content-Security-Policy meta tag to the index file to no avail. I’ve also tried updating the config.xml with <allow-intent href="wss://*/*"/> to no avail.
Again: This same secure WebSocket code works 100% perfectly in my ionic 1.x projects. Any insight would be appreciated. Thanks in advance!