I am using this library - Java-WebSocket
I am using secure websockets and trying to pass a http cookie in the WebSocketClient :
HashMap<String, String> header = new HashMap<String, String>();
header =this.sessionCookie;//session cookie is obtained from https authentication
new WebSocketClient( new URI(serverURL), new Draft_17(), header); //server url is wss://xyzsomething:1100
But this doesn't seem to be working (connection fails). Any ideas as to what am I doing wrong ? Am I not setting the cookie right in the websocketclient ?
So the problem with my socket was that I had to exchange certificates with the server. I had to execute the following function before opening the websocket :