nv-websocket-client icon indicating copy to clipboard operation
nv-websocket-client copied to clipboard

Can't verify hostname after ssl connection handshake

Open biaxident opened this issue 7 years ago • 2 comments

There is no way to verify ssl connection hostname now like in https://developer.android.com/training/articles/security-ssl.html#CommonProblems

Is there is a way to specify HostnameVerifier somehow?

biaxident avatar Apr 11 '17 17:04 biaxident

Probably you can do it by preparing your own SSLContext which verifies hostname and setting it to WebSocketFactory using WebSocketFactory.setSSLContext() method.

You can find an example of setSSLContext() in README.md. NaiveSSLContext.java is an example showing how to create an SSLContext which does not perform any verification at all.

TakahikoKawasaki avatar Apr 19 '17 08:04 TakahikoKawasaki

This is solved by my pull request that was merged in version 2.1. Now it works properly by default.

blunden avatar Apr 23 '17 08:04 blunden