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 ReferenceCountedOpenSslContext
private final long
private final OpenSslKeyMaterialProvider
private final OpenSslSessionCache
private final OpenSslSessionStats
-
Constructor Summary
ConstructorsConstructorDescriptionOpenSslSessionContext
(ReferenceCountedOpenSslContext context, OpenSslKeyMaterialProvider provider, long mask, OpenSslSessionCache cache) -
Method Summary
Modifier and TypeMethodDescription(package private) final void
destroy()
Enumeration
<byte[]> getIds()
getSession
(byte[] bytes) int
int
(package private) final boolean
boolean
Returntrue
if caching of SSL sessions is enabled,false
otherwise.(package private) final void
Remove the givenOpenSslInternalSession
from the cache, and so not re-use it for new connections.void
setSessionCacheEnabled
(boolean enabled) Enable or disable caching of SSL sessions.void
setSessionCacheSize
(int size) (package private) boolean
setSessionFromCache
(long ssl, OpenSslInternalSession session, String host, int port) void
setSessionTimeout
(int seconds) void
setTicketKeys
(byte[] keys) Deprecated.void
setTicketKeys
(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:
setSessionCacheSize
in interfaceSSLSessionContext
-
getSessionCacheSize
public int getSessionCacheSize()- Specified by:
getSessionCacheSize
in interfaceSSLSessionContext
-
setSessionTimeout
public void setSessionTimeout(int seconds) - Specified by:
setSessionTimeout
in interfaceSSLSessionContext
-
getSessionTimeout
public int getSessionTimeout()- Specified by:
getSessionTimeout
in interfaceSSLSessionContext
-
getSession
- Specified by:
getSession
in interfaceSSLSessionContext
-
getIds
- Specified by:
getIds
in 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()Returntrue
if caching of SSL sessions is enabled,false
otherwise. -
stats
Returns the stats of this context. -
removeFromCache
Remove the givenOpenSslInternalSession
from the cache, and so not re-use it for new connections. -
isInCache
-
setSessionFromCache
-
destroy
final void destroy()
-
setTicketKeys(OpenSslSessionTicketKey...)
.