Open
Description
I am currently working on extending this library to accept our self-signed certificate without replacing default socket factory. My current attempt is to add socket factory members in WebSocketOptions.java:
public class WebSocketOptions {
...
private SocketFactory mSocketFactory;
private SSLSocketFactory mSslSocketFactory;
And initialized with default factories in default constructor:
public WebSocketOptions() {
...
mSocketFactory = SocketFactory.getDefault();
mSslSocketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
Also copied in clone constructor:
public WebSocketOptions(WebSocketOptions other) {
...
mSocketFactory = other.mSocketFactory;
mSslSocketFactory = other.mSslSocketFactory;
Then in WebSocketConnection.java, create socket with factories in WebSocketOptions:
private class WebSocketConnector extends Thread {
public void run() {
...
if (mWsScheme.equals("wss")) {
mSocket = mOptions.getSslSocketFactory().createSocket();
} else {
mSocket = mOptions.getSocketFactory().createSocket();
}
Do you accept patches? Or please consider to support this feature in other way. Thanks for your great work!