public class TLSUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
TLSUtils.AcceptAllTrustManager |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROTO_SSL3 |
static java.lang.String |
PROTO_TLSV1 |
static java.lang.String |
PROTO_TLSV1_1 |
static java.lang.String |
PROTO_TLSV1_2 |
static java.lang.String |
SSL |
static java.lang.String |
TLS |
Constructor and Description |
---|
TLSUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
acceptAllCertificates(ConnectionConfiguration conf)
Accept all SSL/TLS certificates.
|
static void |
setEnabledProtocolsAndCiphers(javax.net.ssl.SSLSocket sslSocket,
java.lang.String[] enabledProtocols,
java.lang.String[] enabledCiphers) |
static void |
setSSLv3AndTLSOnly(ConnectionConfiguration conf)
Enable only TLS and SSLv3.
|
static void |
setTLSOnly(ConnectionConfiguration conf)
Enable only TLS.
|
public static final java.lang.String SSL
public static final java.lang.String TLS
public static final java.lang.String PROTO_SSL3
public static final java.lang.String PROTO_TLSV1
public static final java.lang.String PROTO_TLSV1_1
public static final java.lang.String PROTO_TLSV1_2
public static void setTLSOnly(ConnectionConfiguration conf)
According to the Encrypted XMPP Manifesto, TLSv1.2 shall be deployed, providing fallback support for SSLv3 and TLSv1.1. This method goes one step boyond and upgrades the handshake to use TLSv1 or better. This method requires the underlying OS to support all of TLSv1.2 , 1.1 and 1.0.
conf
- the configuration to apply this setting topublic static void setSSLv3AndTLSOnly(ConnectionConfiguration conf)
According to the Encrypted XMPP Manifesto, TLSv1.2 shall be deployed, providing fallback support for SSLv3 and TLSv1.1.
conf
- the configuration to apply this setting topublic static void acceptAllCertificates(ConnectionConfiguration conf) throws java.security.NoSuchAlgorithmException, java.security.KeyManagementException
Warning Use with care. Only use this method if you understand the implications.
conf
- java.security.NoSuchAlgorithmException
java.security.KeyManagementException
public static void setEnabledProtocolsAndCiphers(javax.net.ssl.SSLSocket sslSocket, java.lang.String[] enabledProtocols, java.lang.String[] enabledCiphers) throws SmackException.SecurityNotPossibleException