StompProtocolAndroid
StompProtocolAndroid copied to clipboard
How to pass certificate information or Trust all hosts when connecting to an HTTPS server
I am trying to connect to my server which is over Https but doesnt have a certificate yet. I am getting the following error " javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found." in WebSocketClient.java:167) Code breaks here : this.istream = this.socket.getInputStream();
If I modify the code under WebSocketsConnectionProvider.java : Replace mWebSocketClient.setSocket(factory.createSocket()); with my own SSLWebSocketClientFactory and my own SSL context, it works.
Is there a way that I can call and pass on the SSLWebSocketClientFactory and SSLContext to the WebSocketsConnectionProvider ?
Yep, I want connecting to an HTTPS server too. please help me
It's easy. There's a basic explanation in this section.