Top Description Fields Constructors Methods
io.netty.handler.ssl

public final Class OpenSsl

extends Object
Class Inheritance
Imports
io.netty.buffer.ByteBuf, .ByteBufAllocator, .UnpooledByteBufAllocator, io.netty.internal.tcnative.Buffer, .Library, .SSL, .SSLContext, io.netty.util.CharsetUtil, .ReferenceCountUtil, .ReferenceCounted, io.netty.util.internal.EmptyArrays, .NativeLibraryLoader, .PlatformDependent, .StringUtil, .SystemPropertyUtil, io.netty.util.internal.logging.InternalLogger, .InternalLoggerFactory, java.io.ByteArrayInputStream, java.security.cert.CertificateException, .X509Certificate, java.util.ArrayList, .Arrays, .Collection, .Collections, .HashSet, .LinkedHashSet, .List, .Set

Tells if netty-tcnative and its OpenSSL support are available.

Field Summary

Modifier and TypeField and Description
pack-priv static final Set<String>
private static final Set<String>
private static final Set<String>
private static final String
private static final Set<String>
pack-priv static final List<String>
private static final String[]
pack-priv static final String[]
pack-priv static final String
private static final boolean
pack-priv static final boolean
private static final String
private static final InternalLogger
pack-priv static final String[]
private static final Set<String>
pack-priv static final Set<String>
private static final boolean
private static final boolean
private static final boolean
private static final Throwable
private static final boolean

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Set<String>
public static Set<String>
availableJavaCipherSuites()

Returns all the available cipher suites (Java-style).

public static Set<String>
availableOpenSslCipherSuites()

Returns all the available OpenSSL cipher suites.

pack-priv static String
pack-priv static String[]
defaultProtocols(boolean isClient)

private static boolean
private static boolean
doesSupportProtocol(int protocol, int opt)

public static void
ensureAvailability()

Ensure that netty-tcnative and its OpenSSL support are available.

private static boolean
public static boolean
isAlpnSupported()

Returns true if the used version of openssl supports ALPN.
public static boolean
isAvailable()

Returns true if and only if netty-tcnative and its OpenSSL support are available.

pack-priv static boolean
public static boolean
isCipherSuiteAvailable(String cipherSuite)

Returns true if and only if the specified cipher suite is available in OpenSSL.

public static boolean
isOcspSupported()

Returns true if the used version of OpenSSL supports OCSP stapling.

pack-priv static boolean
pack-priv static boolean
pack-priv static boolean
private static void
pack-priv static long
private static Set<String>
protocols(String property)

pack-priv static void
pack-priv static X509Certificate
selfSignedCertificate()

Returns a self-signed X509Certificate for netty.io.

public static boolean
supportsHostnameValidation()

Deprecated Will be removed because hostname validation is always done by a javax.net.ssl.TrustManager implementation.
Always returns true if isAvailable() returns true.
public static boolean
supportsKeyManagerFactory()

Returns true if javax.net.ssl.KeyManagerFactory is supported when using OpenSSL.

public static Throwable

Returns:

the cause if unavailable. null if available.
unavailabilityCause
()

Returns the cause of unavailability of netty-tcnative and its OpenSSL support.

pack-priv static boolean
public static int
version()

Returns the version of the used available OpenSSL library or -1 if isAvailable() returns false.

public static String
versionString()

Returns the version string of the used available OpenSSL library or null if isAvailable() returns false.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

AVAILABLE_CIPHER_SUITESback to summary
pack-priv static final Set<String> AVAILABLE_CIPHER_SUITES
AVAILABLE_JAVA_CIPHER_SUITESback to summary
private static final Set<String> AVAILABLE_JAVA_CIPHER_SUITES
AVAILABLE_OPENSSL_CIPHER_SUITESback to summary
private static final Set<String> AVAILABLE_OPENSSL_CIPHER_SUITES
CERTback to summary
private static final String CERT
CLIENT_DEFAULT_PROTOCOLSback to summary
private static final Set<String> CLIENT_DEFAULT_PROTOCOLS
DEFAULT_CIPHERSback to summary
pack-priv static final List<String> DEFAULT_CIPHERS
DEFAULT_NAMED_GROUPSback to summary
private static final String[] DEFAULT_NAMED_GROUPS
EXTRA_SUPPORTED_TLS_1_3_CIPHERSback to summary
pack-priv static final String[] EXTRA_SUPPORTED_TLS_1_3_CIPHERS
EXTRA_SUPPORTED_TLS_1_3_CIPHERS_STRINGback to summary
pack-priv static final String EXTRA_SUPPORTED_TLS_1_3_CIPHERS_STRING
IS_BORINGSSLback to summary
private static final boolean IS_BORINGSSL
JAVAX_CERTIFICATE_CREATION_SUPPORTEDback to summary
pack-priv static final boolean JAVAX_CERTIFICATE_CREATION_SUPPORTED
KEYback to summary
private static final String KEY
loggerback to summary
private static final InternalLogger logger
NAMED_GROUPSback to summary
pack-priv static final String[] NAMED_GROUPS
SERVER_DEFAULT_PROTOCOLSback to summary
private static final Set<String> SERVER_DEFAULT_PROTOCOLS
SUPPORTED_PROTOCOLS_SETback to summary
pack-priv static final Set<String> SUPPORTED_PROTOCOLS_SET
SUPPORTS_KEYMANAGER_FACTORYback to summary
private static final boolean SUPPORTS_KEYMANAGER_FACTORY
SUPPORTS_OCSPback to summary
private static final boolean SUPPORTS_OCSP
TLSV13_SUPPORTEDback to summary
private static final boolean TLSV13_SUPPORTED
UNAVAILABILITY_CAUSEback to summary
private static final Throwable UNAVAILABILITY_CAUSE
USE_KEYMANAGER_FACTORYback to summary
private static final boolean USE_KEYMANAGER_FACTORY

Constructor Detail

OpenSslback to summary
private OpenSsl()

Method Detail

availableCipherSuitesback to summary
public static Set<String> availableCipherSuites()
Annotations
@Deprecated
availableJavaCipherSuitesback to summary
public static Set<String> availableJavaCipherSuites()

Returns all the available cipher suites (Java-style). Please note that the returned array may include the cipher suites that are insecure or non-functional.

availableOpenSslCipherSuitesback to summary
public static Set<String> availableOpenSslCipherSuites()

Returns all the available OpenSSL cipher suites. Please note that the returned array may include the cipher suites that are insecure or non-functional.

checkTls13Ciphersback to summary
pack-priv static String checkTls13Ciphers(InternalLogger logger, String ciphers)
defaultProtocolsback to summary
pack-priv static String[] defaultProtocols(boolean isClient)
doesSupportOcspback to summary
private static boolean doesSupportOcsp()
doesSupportProtocolback to summary
private static boolean doesSupportProtocol(int protocol, int opt)
ensureAvailabilityback to summary
public static void ensureAvailability()

Ensure that netty-tcnative and its OpenSSL support are available.

Exceptions
UnsatisfiedLinkError:
if unavailable
initializeTcNativeback to summary
private static boolean initializeTcNative(String engine) throws Exception
isAlpnSupportedback to summary
public static boolean isAlpnSupported()

Returns true if the used version of openssl supports ALPN.

Annotations
@Deprecated
isAvailableback to summary
public static boolean isAvailable()

Returns true if and only if netty-tcnative and its OpenSSL support are available.

isBoringSSLback to summary
pack-priv static boolean isBoringSSL()
isCipherSuiteAvailableback to summary
public static boolean isCipherSuiteAvailable(String cipherSuite)

Returns true if and only if the specified cipher suite is available in OpenSSL. Both Java-style cipher suite and OpenSSL-style cipher suite are accepted.

isOcspSupportedback to summary
public static boolean isOcspSupported()

Returns true if the used version of OpenSSL supports OCSP stapling.

isOptionSupportedback to summary
pack-priv static boolean isOptionSupported(SslContextOption<?> option)
isSessionCacheSupportedback to summary
pack-priv static boolean isSessionCacheSupported()
isTlsv13Supportedback to summary
pack-priv static boolean isTlsv13Supported()
loadTcNativeback to summary
private static void loadTcNative() throws Exception
memoryAddressback to summary
pack-priv static long memoryAddress(ByteBuf buf)
protocolsback to summary
private static Set<String> protocols(String property)
releaseIfNeededback to summary
pack-priv static void releaseIfNeeded(ReferenceCounted counted)
selfSignedCertificateback to summary
pack-priv static X509Certificate selfSignedCertificate() throws CertificateException

Returns a self-signed X509Certificate for netty.io.

supportsHostnameValidationback to summary
public static boolean supportsHostnameValidation()

Deprecated

Will be removed because hostname validation is always done by a javax.net.ssl.TrustManager implementation.

Always returns true if isAvailable() returns true.

Annotations
@Deprecated
supportsKeyManagerFactoryback to summary
public static boolean supportsKeyManagerFactory()

Returns true if javax.net.ssl.KeyManagerFactory is supported when using OpenSSL.

unavailabilityCauseback to summary
public static Throwable unavailabilityCause()

Returns the cause of unavailability of netty-tcnative and its OpenSSL support.

Returns:Throwable

the cause if unavailable. null if available.

useKeyManagerFactoryback to summary
pack-priv static boolean useKeyManagerFactory()
versionback to summary
public static int version()

Returns the version of the used available OpenSSL library or -1 if isAvailable() returns false.

versionStringback to summary
public static String versionString()

Returns the version string of the used available OpenSSL library or null if isAvailable() returns false.