Skip to content

Android WSS Trust #187

Closed
Closed
@Erhannis

Description

@Erhannis

Concerning making WSS connections on Android:
I've discovered that by using a modified piece of SSLClientExample.java, you can just use the device's default trust managers. If, before calling connect(), you insert these 4 lines:

SSLContext sslContext = null;
sslContext = SSLContext.getInstance( "TLS" );
sslContext.init(null, null, null);
mClient.setWebSocketFactory(
new DefaultSSLWebSocketClientFactory(sslContext));

then connect() apparently uses the certificate managers you'd expect, which it doesn't seem to do, otherwise. Seems like this is an easy fix that should be mentioned somewhere, like in the "WSS" section of the readme.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions