I had the same problem.
I found a link https://code.google.com/p/android/issues/detail?id=88313 where I found a code:
public class MySSLSocketFactory extends SSLSocketFactory {
SSLContext sslContext = SSLContext.getInstance("TLS");
...
@Override
public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException, UnknownHostException {
final SSLSocket sslSocket = (SSLSocket) sslContext.getSocketFactory().createSocket(socket, host, port, autoClose);
sslSocket.setEnabledCipherSuites(sslSocket.getSupportedCipherSuites());
return sslSocket;
}
@Override
public Socket createSocket() throws IOException {
final SSLSocket sslSocket = (SSLSocket) sslContext.getSocketFactory().createSocket();
sslSocket.setEnabledCipherSuites(sslSocket.getSupportedCipherSuites());
return sslSocket;
}
}
You can use code of MySSLSocketFactory
from the link you've provided but you need to override two methods createSocket
as I've wrote above.
Also it's not the best solution you can have some security issue later, because for connection it can use some old cipher algorithm.
Hope this helps.