delight-im / Android-DDP

[UNMAINTAINED] Meteor's Distributed Data Protocol (DDP) for clients on Android
Apache License 2.0
274 stars 54 forks source link

Unable to use websocket connection over ssl #152

Closed anarayn closed 5 years ago

anarayn commented 5 years ago

I checked previous threads and understood that Android DDP client supports WebSocket connection for certificates other than self-signed ones. I tried changing my certificate from letsencrypt to a comodo certificate but still, I am not able to use WebSocket over SSL. I am getting below error when I try to connect - E/MainActivity: onException: com.neovisionaries.ws.client.WebSocketException: Failed to get the input stream of the raw socket: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

Is there a way to make this work or its limitation currently? Thanks for help/suggestion and random thoughts.

anarayn commented 5 years ago

After some googling, I realized it could be due to chained certificates. So I created bundle certificate and then still I was getting this error. Then I thought if it is related to the emulator and I tried same by installing apk in my phone and it worked perfectly.

So I am closing this issue.

ocram commented 5 years ago

Thanks a lot for sharing your solution!