StompProtocolAndroid icon indicating copy to clipboard operation
StompProtocolAndroid copied to clipboard

How to pass certificate information or Trust all hosts when connecting to an HTTPS server

Open coolalok opened this issue 7 years ago • 2 comments

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 ?

coolalok avatar May 18 '17 13:05 coolalok

Yep, I want connecting to an HTTPS server too. please help me

lehanphong avatar Jul 17 '17 13:07 lehanphong

It's easy. There's a basic explanation in this section.

forresthopkinsa avatar Aug 03 '17 15:08 forresthopkinsa