SSLEngine and SslHandler.
Internally, it is implemented via JDK's SSLContext or OpenSSL's SSL_CTX.
// In yourChannelInitializer:ChannelPipelinep = channel.pipeline();SslContextsslCtx =SslContextBuilder..build(); p.addLast("ssl",forServer(. . . ) sslCtx.); ...newHandler(channel. alloc())
// In yourChannelInitializer:ChannelPipelinep = channel.pipeline();SslContextsslCtx =SslContextBuilder..build(); p.addLast("ssl",forClient() sslCtx.); ...newHandler(channel. alloc(), host, port)
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final String | |
| private final AttributeMap | |
| private final boolean | |
| pack-priv static final CertificateFactory |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public abstract ApplicationProtocolNegotiator | applicationProtocolNegotiator()
Deprecated
as a consequence of
Returns the object responsible for negotiating application layer protocols for the TLS NPN/ALPN extensions.
ApplicationProtocolNegotiator being deprecated.
|
| public final AttributeMap | |
| protected static KeyManagerFactory | buildKeyManagerFactory(X509Certificate[] certChainFile, String keyAlgorithm, PrivateKey key, String keyPassword, KeyManagerFactory kmf, String keyStore)
|
| pack-priv static KeyManagerFactory | buildKeyManagerFactory(KeyStore ks, String keyAlgorithm, char[] keyPasswordChars, KeyManagerFactory kmf)
|
| protected static KeyStore | Returns: generatedKeyStore.an X.509 certificate chain certChain, PrivateKey a PKCS#8 private key key, char[] the password of the keyPasswordChars, String keyFile.
null if it's not password-protected.The KeyStore Type you want to use keyStoreType)Generates a new |
| protected static TrustManagerFactory | buildTrustManagerFactory(File
The certificate file to build from. certChainFile, TrustManagerFactory The existing trustManagerFactory)TrustManagerFactory that will be used if not null.
Deprecated
Build a TrustManagerFactory from a certificate chain file.
|
| protected static TrustManagerFactory | buildTrustManagerFactory(File
The certificate file to build from. certChainFile, TrustManagerFactory The existing trustManagerFactory, String TrustManagerFactory that will be used if not null.The KeyStore Type you want to use keyType)Build a |
| protected static TrustManagerFactory | buildTrustManagerFactory(X509Certificate[] certCollection, TrustManagerFactory trustManagerFactory, String keyStoreType)
|
| public abstract List | |
| public static SslProvider | |
| private static SslProvider | |
| public static SslProvider | |
| protected static PKCS8EncodedKeySpec | Returns: a key specificationcharacters, if password, byte[] null an unencrypted key is assumedbytes of the DER encoded private key key)
Deprecated
Generates a key specification for an (encrypted) private key.
|
| private static X509Certificate[] | |
| private static PrivateKey | |
| public abstract boolean | |
| public final boolean | |
| pack-priv static char[] | |
| public static SslContext | Returns: a new client-sideSslContext
Deprecated
Replaced by
Creates a new client-side SslContextBuilder
SslContext.
|
| public static SslContext | Returns: a new client-sideSslContextan X.509 certificate chain file in PEM format certChainFile)
Deprecated
Replaced by
Creates a new client-side SslContextBuilder
SslContext.
|
| public static SslContext | Returns: a new client-sideSslContextthe trustManagerFactory)TrustManagerFactory that provides the TrustManagers
that verifies the certificates sent from servers.
null to use the default.
Deprecated
Replaced by
Creates a new client-side SslContextBuilder
SslContext.
|
| public static SslContext | Returns: a new client-sideSslContextan X.509 certificate chain file in PEM format.
certChainFile, TrustManagerFactory null to use the system defaultthe trustManagerFactory)TrustManagerFactory that provides the TrustManagers
that verifies the certificates sent from servers.
null to use the default.
Deprecated
Replaced by
Creates a new client-side SslContextBuilder
SslContext.
|
| public static SslContext | Returns: a new client-sideSslContextan X.509 certificate chain file in PEM format.
certChainFile, TrustManagerFactory null to use the system defaultthe trustManagerFactory, Iterable<String> TrustManagerFactory that provides the TrustManagers
that verifies the certificates sent from servers.
null to use the default.the cipher suites to enable, in the order of preference.
ciphers, Iterable<String> null to use the default cipher suites.the application layer protocols to accept, in the order of preference.
nextProtocols, long null to disable TLS NPN/ALPN extension.the size of the cache used for storing SSL session objects.
sessionCacheSize, long 0 to use the default value.the timeout for the cached SSL session objects, in seconds.
sessionTimeout)0 to use the default value.
Deprecated
Replaced by
Creates a new client-side SslContextBuilder
SslContext.
|
| public static SslContext | Returns: a new client-sideSslContextan X.509 certificate chain file in PEM format.
certChainFile, TrustManagerFactory null to use the system defaultthe trustManagerFactory, Iterable<String> TrustManagerFactory that provides the TrustManagers
that verifies the certificates sent from servers.
null to use the default.the cipher suites to enable, in the order of preference.
ciphers, CipherSuiteFilter null to use the default cipher suites.a filter to apply over the supplied list of ciphers cipherFilter, ApplicationProtocolConfig Provides a means to configure parameters related to application protocol negotiation. apn, long the size of the cache used for storing SSL session objects.
sessionCacheSize, long 0 to use the default value.the timeout for the cached SSL session objects, in seconds.
sessionTimeout)0 to use the default value.
Deprecated
Replaced by
Creates a new client-side SslContextBuilder
SslContext.
|
| public static SslContext | Returns: a new client-sideSslContextthe provider)SslContext implementation to use.
null to use the current default one.
Deprecated
Replaced by
Creates a new client-side SslContextBuilder
SslContext.
|
| public static SslContext | Returns: a new client-sideSslContextthe provider, File SslContext implementation to use.
null to use the current default one.an X.509 certificate chain file in PEM format.
certChainFile)null to use the system default
Deprecated
Replaced by
Creates a new client-side SslContextBuilder
SslContext.
|
| public static SslContext | Returns: a new client-sideSslContextthe provider, TrustManagerFactory SslContext implementation to use.
null to use the current default one.the trustManagerFactory)TrustManagerFactory that provides the TrustManagers
that verifies the certificates sent from servers.
null to use the default.
Deprecated
Replaced by
Creates a new client-side SslContextBuilder
SslContext.
|
| public static SslContext | Returns: a new client-sideSslContextthe provider, File SslContext implementation to use.
null to use the current default one.an X.509 certificate chain file in PEM format.
certChainFile, TrustManagerFactory null to use the system defaultthe trustManagerFactory)TrustManagerFactory that provides the TrustManagers
that verifies the certificates sent from servers.
null to use the default.
Deprecated
Replaced by
Creates a new client-side SslContextBuilder
SslContext.
|
| public static SslContext | Returns: a new client-sideSslContextthe provider, File SslContext implementation to use.
null to use the current default one.an X.509 certificate chain file in PEM format.
certChainFile, TrustManagerFactory null to use the system defaultthe trustManagerFactory, Iterable<String> TrustManagerFactory that provides the TrustManagers
that verifies the certificates sent from servers.
null to use the default.the cipher suites to enable, in the order of preference.
ciphers, Iterable<String> null to use the default cipher suites.the application layer protocols to accept, in the order of preference.
nextProtocols, long null to disable TLS NPN/ALPN extension.the size of the cache used for storing SSL session objects.
sessionCacheSize, long 0 to use the default value.the timeout for the cached SSL session objects, in seconds.
sessionTimeout)0 to use the default value.
Deprecated
Replaced by
Creates a new client-side SslContextBuilder
SslContext.
|
| public static SslContext | Returns: a new client-sideSslContextthe provider, File SslContext implementation to use.
null to use the current default one.an X.509 certificate chain file in PEM format.
certChainFile, TrustManagerFactory null to use the system defaultthe trustManagerFactory, Iterable<String> TrustManagerFactory that provides the TrustManagers
that verifies the certificates sent from servers.
null to use the default.the cipher suites to enable, in the order of preference.
ciphers, CipherSuiteFilter null to use the default cipher suites.a filter to apply over the supplied list of ciphers cipherFilter, ApplicationProtocolConfig Provides a means to configure parameters related to application protocol negotiation. apn, long the size of the cache used for storing SSL session objects.
sessionCacheSize, long 0 to use the default value.the timeout for the cached SSL session objects, in seconds.
sessionTimeout)0 to use the default value.
Deprecated
Replaced by
Creates a new client-side SslContextBuilder
SslContext.
|
| public static SslContext | Returns: a new client-sideSslContextthe provider, File SslContext implementation to use.
null to use the current default one.an X.509 certificate collection file in PEM format.
trustCertCollectionFile, TrustManagerFactory null to use the system defaultthe trustManagerFactory, File TrustManagerFactory that provides the TrustManagers
that verifies the certificates sent from servers.
null to use the default or the results of parsing
trustCertCollectionFile.
This parameter is ignored if provider is not SslProvider#JDK.an X.509 certificate chain file in PEM format.
This provides the public key for mutual authentication.
keyCertChainFile, File null to use the system defaulta PKCS#8 private key file in PEM format.
This provides the private key for mutual authentication.
keyFile, String null for no mutual authentication.the password of the keyPassword, KeyManagerFactory keyFile.
null if it's not password-protected.
Ignored if keyFile is null.the keyManagerFactory, Iterable<String> KeyManagerFactory that provides the KeyManagers
that is used to encrypt data being sent to servers.
null to use the default or the results of parsing
keyCertChainFile and keyFile.
This parameter is ignored if provider is not SslProvider#JDK.the cipher suites to enable, in the order of preference.
ciphers, CipherSuiteFilter null to use the default cipher suites.a filter to apply over the supplied list of ciphers cipherFilter, ApplicationProtocolConfig Provides a means to configure parameters related to application protocol negotiation. apn, long the size of the cache used for storing SSL session objects.
sessionCacheSize, long 0 to use the default value.the timeout for the cached SSL session objects, in seconds.
sessionTimeout)0 to use the default value.
Deprecated
Replaced by
Creates a new client-side SslContextBuilder
SslContext.
|
| pack-priv static SslContext | newClientContextInternal(SslProvider provider, Provider sslContextProvider, X509Certificate[] trustCert, TrustManagerFactory trustManagerFactory, X509Certificate[] keyCertChain, PrivateKey key, String keyPassword, KeyManagerFactory keyManagerFactory, Iterable<String> ciphers, CipherSuiteFilter cipherFilter, ApplicationProtocolConfig apn, String[] protocols, long sessionCacheSize, long sessionTimeout, boolean enableOcsp, String keyStoreType, Map.
|
| public abstract SSLEngine | |
| public abstract SSLEngine | Returns: a newSSLEnginethe non-authoritative name of the host peerHost, int the non-authoritative port peerPort)Creates a new |
| public final SslHandler | |
| protected SslHandler | |
| public SslHandler | Returns: a newSslHandlerIf supported by the SSLEngine then the SSLEngine will use this to allocate Buffer objects. alloc, Executor the delegatedTaskExecutor)Executor that will be used to execute tasks that are returned by
SSLEngine#getDelegatedTask().Creates a new |
| protected SslHandler | |
| public final SslHandler | |
| protected SslHandler | newHandler(BufferAllocator alloc, String peerHost, int peerPort, boolean startTls)
Create a new SslHandler. |
| public SslHandler | Returns: a newSslHandlerIf supported by the SSLEngine then the SSLEngine will use this to allocate Buffer objects. alloc, String the non-authoritative name of the host peerHost, int the non-authoritative port peerPort, Executor the delegatedTaskExecutor)Executor that will be used to execute tasks that are returned by
SSLEngine#getDelegatedTask().Creates a new |
| protected SslHandler | newHandler(BufferAllocator alloc, String peerHost, int peerPort, boolean startTls, Executor delegatedTaskExecutor)
|
| public static SslContext | Returns: a new server-sideSslContextan X.509 certificate chain file in PEM format certChainFile, File a PKCS#8 private key file in PEM format keyFile)
Deprecated
Replaced by
Creates a new server-side SslContextBuilder
SslContext.
|
| public static SslContext | Returns: a new server-sideSslContextan X.509 certificate chain file in PEM format certChainFile, File a PKCS#8 private key file in PEM format keyFile, String the password of the keyPassword)keyFile.
null if it's not password-protected.
Deprecated
Replaced by
Creates a new server-side SslContextBuilder
SslContext.
|
| public static SslContext | Returns: a new server-sideSslContextan X.509 certificate chain file in PEM format certChainFile, File a PKCS#8 private key file in PEM format keyFile, String the password of the keyPassword, Iterable<String> keyFile.
null if it's not password-protected.the cipher suites to enable, in the order of preference.
ciphers, Iterable<String> null to use the default cipher suites.the application layer protocols to accept, in the order of preference.
nextProtocols, long null to disable TLS NPN/ALPN extension.the size of the cache used for storing SSL session objects.
sessionCacheSize, long 0 to use the default value.the timeout for the cached SSL session objects, in seconds.
sessionTimeout)0 to use the default value.
Deprecated
Replaced by
Creates a new server-side SslContextBuilder
SslContext.
|
| public static SslContext | Returns: a new server-sideSslContextan X.509 certificate chain file in PEM format certChainFile, File a PKCS#8 private key file in PEM format keyFile, String the password of the keyPassword, Iterable<String> keyFile.
null if it's not password-protected.the cipher suites to enable, in the order of preference.
ciphers, CipherSuiteFilter null to use the default cipher suites.a filter to apply over the supplied list of ciphers cipherFilter, ApplicationProtocolConfig Provides a means to configure parameters related to application protocol negotiation. apn, long the size of the cache used for storing SSL session objects.
sessionCacheSize, long 0 to use the default value.the timeout for the cached SSL session objects, in seconds.
sessionTimeout)0 to use the default value.
Deprecated
Replaced by
Creates a new server-side SslContextBuilder
SslContext.
|
| public static SslContext | Returns: a new server-sideSslContextthe provider, File SslContext implementation to use.
null to use the current default one.an X.509 certificate chain file in PEM format certChainFile, File a PKCS#8 private key file in PEM format keyFile)
Deprecated
Replaced by
Creates a new server-side SslContextBuilder
SslContext.
|
| public static SslContext | Returns: a new server-sideSslContextthe provider, File SslContext implementation to use.
null to use the current default one.an X.509 certificate chain file in PEM format certChainFile, File a PKCS#8 private key file in PEM format keyFile, String the password of the keyPassword)keyFile.
null if it's not password-protected.
Deprecated
Replaced by
Creates a new server-side SslContextBuilder
SslContext.
|
| public static SslContext | Returns: a new server-sideSslContextthe provider, File SslContext implementation to use.
null to use the current default one.an X.509 certificate chain file in PEM format certChainFile, File a PKCS#8 private key file in PEM format keyFile, String the password of the keyPassword, Iterable<String> keyFile.
null if it's not password-protected.the cipher suites to enable, in the order of preference.
ciphers, Iterable<String> null to use the default cipher suites.the application layer protocols to accept, in the order of preference.
nextProtocols, long null to disable TLS NPN/ALPN extension.the size of the cache used for storing SSL session objects.
sessionCacheSize, long 0 to use the default value.the timeout for the cached SSL session objects, in seconds.
sessionTimeout)0 to use the default value.
Deprecated
Replaced by
Creates a new server-side SslContextBuilder
SslContext.
|
| public static SslContext | Returns: a new server-sideSslContextthe provider, File SslContext implementation to use.
null to use the current default one.an X.509 certificate chain file in PEM format certChainFile, File a PKCS#8 private key file in PEM format keyFile, String the password of the keyPassword, TrustManagerFactory keyFile.
null if it's not password-protected.the trustManagerFactory, Iterable<String> TrustManagerFactory that provides the TrustManagers
that verifies the certificates sent from servers.
null to use the default.the cipher suites to enable, in the order of preference.
ciphers, Iterable<String> null to use the default cipher suites.the application layer protocols to accept, in the order of preference.
nextProtocols, long null to disable TLS NPN/ALPN extension.the size of the cache used for storing SSL session objects.
sessionCacheSize, long 0 to use the default value.the timeout for the cached SSL session objects, in seconds.
sessionTimeout)0 to use the default value.
Deprecated
Replaced by
Creates a new server-side SslContextBuilder
SslContext.
|
| public static SslContext | Returns: a new server-sideSslContextthe provider, File SslContext implementation to use.
null to use the current default one.an X.509 certificate chain file in PEM format certChainFile, File a PKCS#8 private key file in PEM format keyFile, String the password of the keyPassword, Iterable<String> keyFile.
null if it's not password-protected.the cipher suites to enable, in the order of preference.
ciphers, CipherSuiteFilter null to use the default cipher suites.a filter to apply over the supplied list of ciphers
Only required if cipherFilter, ApplicationProtocolConfig provider is SslProvider#JDKProvides a means to configure parameters related to application protocol negotiation. apn, long the size of the cache used for storing SSL session objects.
sessionCacheSize, long 0 to use the default value.the timeout for the cached SSL session objects, in seconds.
sessionTimeout)0 to use the default value.
Deprecated
Replaced by
Creates a new server-side SslContextBuilder
SslContext.
|
| public static SslContext | Returns: a new server-sideSslContextthe provider, File SslContext implementation to use.
null to use the current default one.an X.509 certificate collection file in PEM format.
This provides the certificate collection used for mutual authentication.
trustCertCollectionFile, TrustManagerFactory null to use the system defaultthe trustManagerFactory, File TrustManagerFactory that provides the TrustManagers
that verifies the certificates sent from clients.
null to use the default or the results of parsing
trustCertCollectionFile.
This parameter is ignored if provider is not SslProvider#JDK.an X.509 certificate chain file in PEM format keyCertChainFile, File a PKCS#8 private key file in PEM format keyFile, String the password of the keyPassword, KeyManagerFactory keyFile.
null if it's not password-protected.the keyManagerFactory, Iterable<String> KeyManagerFactory that provides the KeyManagers
that is used to encrypt data being sent to clients.
null to use the default or the results of parsing
keyCertChainFile and keyFile.
This parameter is ignored if provider is not SslProvider#JDK.the cipher suites to enable, in the order of preference.
ciphers, CipherSuiteFilter null to use the default cipher suites.a filter to apply over the supplied list of ciphers
Only required if cipherFilter, ApplicationProtocolConfig provider is SslProvider#JDKProvides a means to configure parameters related to application protocol negotiation. apn, long the size of the cache used for storing SSL session objects.
sessionCacheSize, long 0 to use the default value.the timeout for the cached SSL session objects, in seconds.
sessionTimeout)0 to use the default value.
Deprecated
Replaced by
Creates a new server-side SslContextBuilder
SslContext.
|
| pack-priv static SslContext | Returns: a new server-sideSslContextthe provider, File SslContext implementation to use.
null to use the current default one.an X.509 certificate collection file in PEM format.
This provides the certificate collection used for mutual authentication.
trustCertCollectionFile, TrustManagerFactory null to use the system defaultthe trustManagerFactory, File TrustManagerFactory that provides the TrustManagers
that verifies the certificates sent from clients.
null to use the default or the results of parsing
trustCertCollectionFile.
This parameter is ignored if provider is not SslProvider#JDK.an X.509 certificate chain file in PEM format keyCertChainFile, File a PKCS#8 private key file in PEM format keyFile, String the password of the keyPassword, KeyManagerFactory keyFile.
null if it's not password-protected.the keyManagerFactory, Iterable<String> KeyManagerFactory that provides the KeyManagers
that is used to encrypt data being sent to clients.
null to use the default or the results of parsing
keyCertChainFile and keyFile.
This parameter is ignored if provider is not SslProvider#JDK.the cipher suites to enable, in the order of preference.
ciphers, CipherSuiteFilter null to use the default cipher suites.a filter to apply over the supplied list of ciphers
Only required if cipherFilter, ApplicationProtocolConfig provider is SslProvider#JDKProvides a means to configure parameters related to application protocol negotiation. apn, long the size of the cache used for storing SSL session objects.
sessionCacheSize, long 0 to use the default value.the timeout for the cached SSL session objects, in seconds.
sessionTimeout, String 0 to use the default value.the keystore type that should be used keyStore)Creates a new server-side |
| pack-priv static SslContext | newServerContextInternal(SslProvider provider, Provider sslContextProvider, X509Certificate[] trustCertCollection, TrustManagerFactory trustManagerFactory, X509Certificate[] keyCertChain, PrivateKey key, String keyPassword, KeyManagerFactory keyManagerFactory, Iterable<String> ciphers, CipherSuiteFilter cipherFilter, ApplicationProtocolConfig apn, long sessionCacheSize, long sessionTimeout, ClientAuth clientAuth, String[] protocols, boolean startTls, boolean enableOcsp, String keyStoreType, Map.
|
| public final List | |
| public long | |
| public abstract SSLSessionContext | |
| public long | |
| pack-priv static ApplicationProtocolConfig | |
| protected static PrivateKey | |
| protected static PrivateKey | |
| pack-priv static PrivateKey | |
| protected static X509Certificate[] | |
| protected static X509Certificate[] | |
| pack-priv static X509Certificate[] | |
| private static void |