Package io.netty.handler.ssl
Class OpenSslSessionContext
- java.lang.Object
-
- io.netty.handler.ssl.OpenSslSessionContext
-
- All Implemented Interfaces:
javax.net.ssl.SSLSessionContext
- Direct Known Subclasses:
OpenSslServerSessionContext
,ReferenceCountedOpenSslClientContext.OpenSslClientSessionContext
public abstract class OpenSslSessionContext extends java.lang.Object implements javax.net.ssl.SSLSessionContext
OpenSSL specificSSLSessionContext
implementation.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) ReferenceCountedOpenSslContext
context
private long
mask
private OpenSslKeyMaterialProvider
provider
private OpenSslSessionCache
sessionCache
private OpenSslSessionStats
stats
-
Constructor Summary
Constructors Constructor Description OpenSslSessionContext(ReferenceCountedOpenSslContext context, OpenSslKeyMaterialProvider provider, long mask, OpenSslSessionCache cache)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description (package private) void
destroy()
java.util.Enumeration<byte[]>
getIds()
javax.net.ssl.SSLSession
getSession(byte[] bytes)
int
getSessionCacheSize()
int
getSessionTimeout()
(package private) boolean
isInCache(OpenSslSessionId id)
boolean
isSessionCacheEnabled()
Returntrue
if caching of SSL sessions is enabled,false
otherwise.(package private) void
removeFromCache(OpenSslSessionId id)
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, java.lang.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.OpenSslSessionStats
stats()
Returns the stats of this context.(package private) boolean
useKeyManager()
-
-
-
Field Detail
-
stats
private final OpenSslSessionStats stats
-
provider
private final OpenSslKeyMaterialProvider provider
-
context
final ReferenceCountedOpenSslContext context
-
sessionCache
private final OpenSslSessionCache sessionCache
-
mask
private final long mask
-
-
Constructor Detail
-
OpenSslSessionContext
OpenSslSessionContext(ReferenceCountedOpenSslContext context, OpenSslKeyMaterialProvider provider, long mask, OpenSslSessionCache cache)
-
-
Method Detail
-
useKeyManager
final boolean useKeyManager()
-
setSessionCacheSize
public void setSessionCacheSize(int size)
- Specified by:
setSessionCacheSize
in interfacejavax.net.ssl.SSLSessionContext
-
getSessionCacheSize
public int getSessionCacheSize()
- Specified by:
getSessionCacheSize
in interfacejavax.net.ssl.SSLSessionContext
-
setSessionTimeout
public void setSessionTimeout(int seconds)
- Specified by:
setSessionTimeout
in interfacejavax.net.ssl.SSLSessionContext
-
getSessionTimeout
public int getSessionTimeout()
- Specified by:
getSessionTimeout
in interfacejavax.net.ssl.SSLSessionContext
-
getSession
public javax.net.ssl.SSLSession getSession(byte[] bytes)
- Specified by:
getSession
in interfacejavax.net.ssl.SSLSessionContext
-
getIds
public java.util.Enumeration<byte[]> getIds()
- Specified by:
getIds
in interfacejavax.net.ssl.SSLSessionContext
-
setTicketKeys
@Deprecated public void setTicketKeys(byte[] keys)
Deprecated.Sets the SSL session ticket keys of this context.
-
setTicketKeys
public void setTicketKeys(OpenSslSessionTicketKey... keys)
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
public OpenSslSessionStats stats()
Returns the stats of this context.
-
removeFromCache
final void removeFromCache(OpenSslSessionId id)
Remove the givenOpenSslInternalSession
from the cache, and so not re-use it for new connections.
-
isInCache
final boolean isInCache(OpenSslSessionId id)
-
setSessionFromCache
boolean setSessionFromCache(long ssl, OpenSslInternalSession session, java.lang.String host, int port)
-
destroy
final void destroy()
-
-