Top Description Inners Fields Constructors Methods
io.netty5.handler.ssl

public final Class ReferenceCountedOpenSslClientContext

extends ReferenceCountedOpenSslContext
Class Inheritance
Imports
io.netty.internal.tcnative.CertificateCallback, .SSL, .SSLContext, io.netty5.util.internal.EmptyArrays, javax.net.ssl.KeyManagerFactory, .SSLException, .TrustManagerFactory, .X509ExtendedTrustManager, .X509TrustManager, javax.security.auth.x500.X500Principal, java.security.KeyStore, .PrivateKey, java.security.cert.X509Certificate, java.util.Arrays, .Collections, .HashSet, .LinkedHashSet, .Map, .Set

A client-side SslContext which uses OpenSSL's SSL/TLS implementation.

Instances of this class must be released or else native memory will leak!

Instances of this class must not be released before any ReferenceCountedOpenSslEngine which depends upon the instance of this class is released. Otherwise if any method of ReferenceCountedOpenSslEngine is called which uses this class's JNI resources the JVM may crash.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
pack-priv static class
private static class

Field Summary

Modifier and TypeField and Description
private final OpenSslSessionContext
private static final Set<String>
Inherited from io.netty5.handler.ssl.ReferenceCountedOpenSslContext:
CLIENT_ENABLE_SESSION_CACHECLIENT_ENABLE_SESSION_TICKETCLIENT_ENABLE_SESSION_TICKET_TLSV13clientAuthctxctxLockenableOcspengineMapkeyCertChainNONE_PROTOCOL_NEGOTIATORprotocolsSERVER_ENABLE_SESSION_CACHESERVER_ENABLE_SESSION_TICKETSERVER_ENABLE_SESSION_TICKET_TLSV13tlsFalseStartUSE_TASKSVERIFY_DEPTH

Constructor Summary

AccessConstructor and Description
pack-priv
ReferenceCountedOpenSslClientContext(X509Certificate[] trustCertCollection, 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 keyStore, Map.Entry<SslContextOption<?>, Object>... options)

Method Summary

Modifier and TypeMethod and Description
pack-priv static OpenSslSessionContext
newSessionContext(ReferenceCountedOpenSslContext thiz, long ctx, OpenSslEngineMap engineMap, X509Certificate[] trustCertCollection, TrustManagerFactory trustManagerFactory, X509Certificate[] keyCertChain, PrivateKey key, String keyPassword, KeyManagerFactory keyManagerFactory, String keyStore, long sessionCacheSize, long sessionTimeout)

public OpenSslSessionContext
sessionContext()

Implements abstract io.netty5.handler.ssl.ReferenceCountedOpenSslContext.sessionContext.

Returns the SSLSessionContext object held by this context.
Inherited from io.netty5.handler.ssl.ReferenceCountedOpenSslContext:
applicationProtocolNegotiatorcertificateschooseTrustManagerchooseX509KeyManagercipherSuitescontextfreeBiogetBioNonApplicationBufferSizegetRejectRemoteInitiatedRenegotiationisClientnewEnginenewEnginenewEngine0newHandlernewHandlernewHandlernewHandlerproviderForrefCntreleasereleaseretainretainsetBioNonApplicationBufferSizesetKeyMaterialsetPrivateKeyMethodsetRejectRemoteInitiatedRenegotiationsetTicketKeyssetUseTaskssslCtxPointerstatstoBIOtoBIOtoBIOtoNegotiatortouchtouchuseExtendedTrustManager

Field Detail

sessionContextback to summary
private final OpenSslSessionContext sessionContext
SUPPORTED_KEY_TYPESback to summary
private static final Set<String> SUPPORTED_KEY_TYPES

Constructor Detail

ReferenceCountedOpenSslClientContextback to summary
pack-priv ReferenceCountedOpenSslClientContext(X509Certificate[] trustCertCollection, 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 keyStore, Map.Entry<SslContextOption<?>, Object>... options) throws SSLException

Method Detail

newSessionContextback to summary
pack-priv static OpenSslSessionContext newSessionContext(ReferenceCountedOpenSslContext thiz, long ctx, OpenSslEngineMap engineMap, X509Certificate[] trustCertCollection, TrustManagerFactory trustManagerFactory, X509Certificate[] keyCertChain, PrivateKey key, String keyPassword, KeyManagerFactory keyManagerFactory, String keyStore, long sessionCacheSize, long sessionTimeout) throws SSLException
sessionContextback to summary
public OpenSslSessionContext sessionContext()

Implements abstract io.netty5.handler.ssl.ReferenceCountedOpenSslContext.sessionContext.

Doc from io.netty5.handler.ssl.SslContext.sessionContext.

Returns the SSLSessionContext object held by this context.

Annotations
@Override
io.netty5.handler.ssl back to summary

private final Class ReferenceCountedOpenSslClientContext.ExtendedTrustManagerVerifyCallback

extends AbstractCertificateVerifier
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final X509ExtendedTrustManager

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
Inherited from io.netty5.handler.ssl.ReferenceCountedOpenSslContext.AbstractCertificateVerifier:
verify

Field Detail

managerback to summary
private final X509ExtendedTrustManager manager

Constructor Detail

ExtendedTrustManagerVerifyCallbackback to summary
pack-priv ExtendedTrustManagerVerifyCallback(OpenSslEngineMap engineMap, X509ExtendedTrustManager manager)

Method Detail

verifyback to summary
pack-priv void verify(ReferenceCountedOpenSslEngine engine, X509Certificate[] peerCerts, String auth) throws Exception

Implements abstract io.netty5.handler.ssl.ReferenceCountedOpenSslContext.AbstractCertificateVerifier.verify.

Annotations
@Override
io.netty5.handler.ssl back to summary

private final Class ReferenceCountedOpenSslClientContext.OpenSslClientCertificateCallback

extends Object
implements CertificateCallback
Class Inheritance
  • java.lang.Object
  • io.netty5.handler.ssl.ReferenceCountedOpenSslClientContext.OpenSslClientCertificateCallback
All Implemented Interfaces
io.netty.internal.tcnative.CertificateCallback

Field Summary

Modifier and TypeField and Description
private final OpenSslEngineMap
private final OpenSslKeyMaterialManager

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static String
clientKeyType(byte clientCertificateType)

public void
handle(long
the SSL instance
ssl
,
byte[]
an array of the key types on client-mode or null on server-mode.
keyTypeBytes
,
byte[][]
the principals or null.
asn1DerEncodedPrincipals
)

Implements io.netty.internal.tcnative.CertificateCallback.handle.

Called during cert selection.
private static Set<String>

Returns:

supported key types that can be used in X509KeyManager.chooseClientAlias and X509ExtendedKeyManager.chooseEngineClientAlias.
supportedClientKeyTypes
(byte[]
ClientCertificateType values provided by the server. See https://www.ietf.org/assignments/tls-parameters/tls-parameters.xml.
clientCertificateTypes
)

Gets the supported key types for client certificates.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

engineMapback to summary
private final OpenSslEngineMap engineMap
keyManagerHolderback to summary
private final OpenSslKeyMaterialManager keyManagerHolder

Constructor Detail

OpenSslClientCertificateCallbackback to summary
pack-priv OpenSslClientCertificateCallback(OpenSslEngineMap engineMap, OpenSslKeyMaterialManager keyManagerHolder)

Method Detail

clientKeyTypeback to summary
private static String clientKeyType(byte clientCertificateType)
handleback to summary
public void handle(long ssl, byte[] keyTypeBytes, byte[][] asn1DerEncodedPrincipals) throws Exception

Implements io.netty.internal.tcnative.CertificateCallback.handle.

Doc from io.netty.internal.tcnative.CertificateCallback.handle.

Called during cert selection. If a certificate chain / key should be used SSL#setKeyMaterial(long, long, long) must be called from this callback after all preparations / validations were completed.

Parameters
ssl:long

the SSL instance

keyTypeBytes:byte[]

an array of the key types on client-mode or null on server-mode.

asn1DerEncodedPrincipals:byte[][]

the principals or null.

Annotations
@Override
supportedClientKeyTypesback to summary
private static Set<String> supportedClientKeyTypes(byte[] clientCertificateTypes)

Gets the supported key types for client certificates.

Parameters
clientCertificateTypes:byte[]

ClientCertificateType values provided by the server. See https://www.ietf.org/assignments/tls-parameters/tls-parameters.xml.

Returns:Set<String>

supported key types that can be used in X509KeyManager.chooseClientAlias and X509ExtendedKeyManager.chooseEngineClientAlias.

io.netty5.handler.ssl back to summary

pack-priv final Class ReferenceCountedOpenSslClientContext.OpenSslClientSessionContext

extends OpenSslSessionContext
Class Inheritance

Field Summary

Inherited from io.netty5.handler.ssl.OpenSslSessionContext:
context

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from io.netty5.handler.ssl.OpenSslSessionContext:
destroygetIdsgetSessiongetSessionCacheSizegetSessionTimeoutisInCacheisSessionCacheEnabledremoveFromCachesetSessionCacheEnabledsetSessionCacheSizesetSessionFromCachesetSessionTimeoutsetTicketKeyssetTicketKeysstatsuseKeyManager

Constructor Detail

OpenSslClientSessionContextback to summary
pack-priv OpenSslClientSessionContext(ReferenceCountedOpenSslContext context, OpenSslKeyMaterialProvider provider)
io.netty5.handler.ssl back to summary

private final Class ReferenceCountedOpenSslClientContext.TrustManagerVerifyCallback

extends AbstractCertificateVerifier
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final X509TrustManager

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
Inherited from io.netty5.handler.ssl.ReferenceCountedOpenSslContext.AbstractCertificateVerifier:
verify

Field Detail

managerback to summary
private final X509TrustManager manager

Constructor Detail

TrustManagerVerifyCallbackback to summary
pack-priv TrustManagerVerifyCallback(OpenSslEngineMap engineMap, X509TrustManager manager)

Method Detail

verifyback to summary
pack-priv void verify(ReferenceCountedOpenSslEngine engine, X509Certificate[] peerCerts, String auth) throws Exception

Implements abstract io.netty5.handler.ssl.ReferenceCountedOpenSslContext.AbstractCertificateVerifier.verify.

Annotations
@Override