public class TLSUtils
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TLSUtils.AcceptAllTrustManager
A
X509TrustManager that doesn't validate X.509 certificates. |
| 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 <B extends ConnectionConfiguration.ConnectionConfigurationBuilder<B,?>> |
acceptAllCertificates(B builder)
Accept all SSL/TLS certificates.
|
static void |
setEnabledProtocolsAndCiphers(javax.net.ssl.SSLSocket sslSocket,
java.lang.String[] enabledProtocols,
java.lang.String[] enabledCiphers) |
static <B extends ConnectionConfiguration.ConnectionConfigurationBuilder<B,?>> |
setSSLv3AndTLSOnly(B builder)
Enable only TLS and SSLv3.
|
static <B extends ConnectionConfiguration.ConnectionConfigurationBuilder<B,?>> |
setTLSOnly(B builder)
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 <B extends ConnectionConfiguration.ConnectionConfigurationBuilder<B,?>> B setTLSOnly(B builder)
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.
builder - the configuration builder to apply this setting topublic static <B extends ConnectionConfiguration.ConnectionConfigurationBuilder<B,?>> B setSSLv3AndTLSOnly(B builder)
According to the Encrypted XMPP Manifesto, TLSv1.2 shall be deployed, providing fallback support for SSLv3 and TLSv1.1.
builder - the configuration builder to apply this setting topublic static <B extends ConnectionConfiguration.ConnectionConfigurationBuilder<B,?>> B acceptAllCertificates(B builder) throws java.security.NoSuchAlgorithmException, java.security.KeyManagementException
Warning Use with care. This method make the Connection use
TLSUtils.AcceptAllTrustManager. Only use this method if you understand the implications.
builder - java.security.NoSuchAlgorithmExceptionjava.security.KeyManagementExceptionpublic static void setEnabledProtocolsAndCiphers(javax.net.ssl.SSLSocket sslSocket,
java.lang.String[] enabledProtocols,
java.lang.String[] enabledCiphers)
throws SmackException.SecurityNotPossibleException