Package io.netty.handler.ssl
Class OpenSslSessionContext
java.lang.Object
io.netty.handler.ssl.OpenSslSessionContext
- All Implemented Interfaces:
SSLSessionContext
- Direct Known Subclasses:
OpenSslServerSessionContext,ReferenceCountedOpenSslClientContext.OpenSslClientSessionContext
OpenSSL specific
SSLSessionContext implementation.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final ReferenceCountedOpenSslContextprivate final longprivate final OpenSslKeyMaterialProviderprivate final OpenSslSessionCacheprivate final OpenSslSessionStats -
Constructor Summary
ConstructorsConstructorDescriptionOpenSslSessionContext(ReferenceCountedOpenSslContext context, OpenSslKeyMaterialProvider provider, long mask, OpenSslSessionCache cache) -
Method Summary
Modifier and TypeMethodDescription(package private) final voiddestroy()Enumeration<byte[]> getIds()getSession(byte[] bytes) intint(package private) final booleanbooleanReturntrueif caching of SSL sessions is enabled,falseotherwise.(package private) final voidRemove the givenOpenSslInternalSessionfrom the cache, and so not re-use it for new connections.voidsetSessionCacheEnabled(boolean enabled) Enable or disable caching of SSL sessions.voidsetSessionCacheSize(int size) (package private) booleansetSessionFromCache(long ssl, OpenSslInternalSession session, String host, int port) voidsetSessionTimeout(int seconds) voidsetTicketKeys(byte[] keys) Deprecated.voidsetTicketKeys(OpenSslSessionTicketKey... keys) Sets the SSL session ticket keys of this context.stats()Returns the stats of this context.(package private) final boolean
-
Field Details
-
stats
-
provider
-
context
-
sessionCache
-
mask
private final long mask
-
-
Constructor Details
-
OpenSslSessionContext
OpenSslSessionContext(ReferenceCountedOpenSslContext context, OpenSslKeyMaterialProvider provider, long mask, OpenSslSessionCache cache)
-
-
Method Details
-
useKeyManager
final boolean useKeyManager() -
setSessionCacheSize
public void setSessionCacheSize(int size) - Specified by:
setSessionCacheSizein interfaceSSLSessionContext
-
getSessionCacheSize
public int getSessionCacheSize()- Specified by:
getSessionCacheSizein interfaceSSLSessionContext
-
setSessionTimeout
public void setSessionTimeout(int seconds) - Specified by:
setSessionTimeoutin interfaceSSLSessionContext
-
getSessionTimeout
public int getSessionTimeout()- Specified by:
getSessionTimeoutin interfaceSSLSessionContext
-
getSession
- Specified by:
getSessionin interfaceSSLSessionContext
-
getIds
- Specified by:
getIdsin interfaceSSLSessionContext
-
setTicketKeys
Deprecated.Sets the SSL session ticket keys of this context. -
setTicketKeys
Sets the SSL session ticket keys of this context. Depending on the underlying native library you may omit the argument or pass an empty array and so let the native library handle the key generation and rotating for you. If this is supported by the underlying native library should be checked in this case. For example BoringSSL is known to support this. -
setSessionCacheEnabled
public void setSessionCacheEnabled(boolean enabled) Enable or disable caching of SSL sessions. -
isSessionCacheEnabled
public boolean isSessionCacheEnabled()Returntrueif caching of SSL sessions is enabled,falseotherwise. -
stats
Returns the stats of this context. -
removeFromCache
Remove the givenOpenSslInternalSessionfrom the cache, and so not re-use it for new connections. -
isInCache
-
setSessionFromCache
-
destroy
final void destroy()
-
setTicketKeys(OpenSslSessionTicketKey...).