public class TlsOnlySocketFactory
extends javax.net.ssl.SSLSocketFactory
HttpsURLConnection
falls
back to SSLv3 from TLSv1. This is a bug in android versions < 4.4. It can be
fixed by removing the SSLv3 protocol from Enabled Protocols list. Use this as
the SSLSocketFactory
for
HttpsURLConnection.setDefaultSSLSocketFactory(SSLSocketFactory)
table of protocols and ciphers Android supports
,
source of protocol name constantsModifier and Type | Class and Description |
---|---|
class |
TlsOnlySocketFactory.DelegateSSLSocket |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SSLV2 |
static java.lang.String |
SSLV3 |
static java.lang.String |
TLSV1 |
static java.lang.String |
TLSV1_1 |
static java.lang.String |
TLSV1_2 |
Constructor and Description |
---|
TlsOnlySocketFactory() |
TlsOnlySocketFactory(javax.net.ssl.SSLSocketFactory delegate) |
TlsOnlySocketFactory(javax.net.ssl.SSLSocketFactory delegate,
boolean compatible)
Make
SSLSocket s that are compatible with outdated servers. |
Modifier and Type | Method and Description |
---|---|
java.net.Socket |
createSocket(java.net.InetAddress host,
int port) |
java.net.Socket |
createSocket(java.net.InetAddress address,
int port,
java.net.InetAddress localAddress,
int localPort) |
java.net.Socket |
createSocket(java.net.Socket s,
java.lang.String host,
int port,
boolean autoClose) |
java.net.Socket |
createSocket(java.lang.String host,
int port) |
java.net.Socket |
createSocket(java.lang.String host,
int port,
java.net.InetAddress localHost,
int localPort) |
java.lang.String[] |
getDefaultCipherSuites() |
java.lang.String[] |
getSupportedCipherSuites() |
public static final java.lang.String TLSV1_2
public static final java.lang.String TLSV1_1
public static final java.lang.String TLSV1
public static final java.lang.String SSLV3
public static final java.lang.String SSLV2
public TlsOnlySocketFactory()
public TlsOnlySocketFactory(javax.net.ssl.SSLSocketFactory delegate)
public TlsOnlySocketFactory(javax.net.ssl.SSLSocketFactory delegate, boolean compatible)
SSLSocket
s that are compatible with outdated servers.delegate
- compatible
- public java.lang.String[] getDefaultCipherSuites()
getDefaultCipherSuites
in class javax.net.ssl.SSLSocketFactory
public java.lang.String[] getSupportedCipherSuites()
getSupportedCipherSuites
in class javax.net.ssl.SSLSocketFactory
public java.net.Socket createSocket(java.net.Socket s, java.lang.String host, int port, boolean autoClose) throws java.io.IOException
createSocket
in class javax.net.ssl.SSLSocketFactory
java.io.IOException
public java.net.Socket createSocket(java.lang.String host, int port) throws java.io.IOException
createSocket
in class javax.net.SocketFactory
java.io.IOException
public java.net.Socket createSocket(java.lang.String host, int port, java.net.InetAddress localHost, int localPort) throws java.io.IOException
createSocket
in class javax.net.SocketFactory
java.io.IOException
public java.net.Socket createSocket(java.net.InetAddress host, int port) throws java.io.IOException
createSocket
in class javax.net.SocketFactory
java.io.IOException
public java.net.Socket createSocket(java.net.InetAddress address, int port, java.net.InetAddress localAddress, int localPort) throws java.io.IOException
createSocket
in class javax.net.SocketFactory
java.io.IOException