The browser is probably trying to show you the "do you accept this self-signed certificate" dialog, but can't because the websocket connection is invisible. To use wss: with a self-signed certificate you must first visit a regular html page with that certificate so you can accept it.