Class ExtendedOpenSslSession
java.lang.Object
javax.net.ssl.ExtendedSSLSession
io.netty.handler.ssl.ExtendedOpenSslSession
- All Implemented Interfaces:
OpenSslInternalSession, OpenSslSession, SSLSession
Delegates all operations to a wrapped
OpenSslInternalSession except the methods defined by
ExtendedSSLSession itself.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String[]private final OpenSslInternalSession -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanfinal intfinal Stringfinal longfinal byte[]getId()final longfinal Certificate[]final Principalfinal String[]final intfinal X509Certificate[]final Certificate[]final Stringfinal intfinal PrincipalString[]abstract Listfinal OpenSslSessionContextList<byte[]> final Objectfinal String[]voidhandshakeFinished(byte[] id, String cipher, String protocol, byte[] peerCertificate, byte[][] peerCertificateChain, long creationTime, long timeout) Called once the handshake has completed.inthashCode()booleanReturns true if the peer has provided certificates during the handshake.final voidfinal booleanisValid()Return the underlyingMapthat is used by the following methods:SSLSession.putValue(String, Object)SSLSession.removeValue(String)SSLSession.getValue(String)SSLSession.getValueNames()TheMapmust be thread-safe!voidCalled on a handshake session before being exposed to aTrustManager.final voidfinal voidReturn theOpenSslSessionIdthat can be used to identify this session.voidsetLastAccessedTime(long time) Set the last access time which will be returned bySSLSession.getLastAccessedTime().final voidsetLocalCertificate(Certificate[] localCertificate) Set the local certificate chain that is used.voidsetSessionDetails(long creationTime, long lastAccessedTime, OpenSslSessionId id, Map<String, Object> keyValueStorage) Set the details for the session which might come from a cache.toString()final voidtryExpandApplicationBufferSize(int packetLengthDataOnly) Expand (or increase) the value returned bySSLSession.getApplicationBufferSize()if necessary.
-
Field Details
-
LOCAL_SUPPORTED_SIGNATURE_ALGORITHMS
-
wrapped
-
-
Constructor Details
-
ExtendedOpenSslSession
ExtendedOpenSslSession(OpenSslInternalSession wrapped)
-
-
Method Details
-
getRequestedServerNames
- Overrides:
getRequestedServerNamesin classExtendedSSLSession
-
getStatusResponses
-
prepareHandshake
public void prepareHandshake()Description copied from interface:OpenSslInternalSessionCalled on a handshake session before being exposed to aTrustManager. Session data must be cleared by this call.- Specified by:
prepareHandshakein interfaceOpenSslInternalSession
-
keyValueStorage
Description copied from interface:OpenSslInternalSessionReturn the underlyingMapthat is used by the following methods:SSLSession.putValue(String, Object)SSLSession.removeValue(String)SSLSession.getValue(String)-
SSLSession.getValueNames()
Mapmust be thread-safe!- Specified by:
keyValueStoragein interfaceOpenSslInternalSession- Returns:
- storage
-
sessionId
Description copied from interface:OpenSslInternalSessionReturn theOpenSslSessionIdthat can be used to identify this session.- Specified by:
sessionIdin interfaceOpenSslInternalSession
-
setSessionDetails
public void setSessionDetails(long creationTime, long lastAccessedTime, OpenSslSessionId id, Map<String, Object> keyValueStorage) Description copied from interface:OpenSslInternalSessionSet the details for the session which might come from a cache.- Specified by:
setSessionDetailsin interfaceOpenSslInternalSession- Parameters:
creationTime- the time at which the session was created.lastAccessedTime- the time at which the session was last accessed via the session infrastructure (cache).id- theOpenSslSessionIdkeyValueStorage- the key value store. SeeOpenSslInternalSession.keyValueStorage().
-
setLocalCertificate
Description copied from interface:OpenSslInternalSessionSet the local certificate chain that is used. It is not expected that this array will be changed at all and so its ok to not copy the array.- Specified by:
setLocalCertificatein interfaceOpenSslInternalSession
-
getPeerSupportedSignatureAlgorithms
- Specified by:
getPeerSupportedSignatureAlgorithmsin classExtendedSSLSession
-
tryExpandApplicationBufferSize
public final void tryExpandApplicationBufferSize(int packetLengthDataOnly) Description copied from interface:OpenSslInternalSessionExpand (or increase) the value returned bySSLSession.getApplicationBufferSize()if necessary.This is only called in a synchronized block, so no need to use atomic operations.
- Specified by:
tryExpandApplicationBufferSizein interfaceOpenSslInternalSession- Parameters:
packetLengthDataOnly- The packet size which exceeds the currentSSLSession.getApplicationBufferSize().
-
getLocalSupportedSignatureAlgorithms
- Specified by:
getLocalSupportedSignatureAlgorithmsin classExtendedSSLSession
-
getId
public final byte[] getId()- Specified by:
getIdin interfaceSSLSession
-
getSessionContext
- Specified by:
getSessionContextin interfaceOpenSslSession- Specified by:
getSessionContextin interfaceSSLSession
-
getCreationTime
public final long getCreationTime()- Specified by:
getCreationTimein interfaceSSLSession
-
getLastAccessedTime
public final long getLastAccessedTime()- Specified by:
getLastAccessedTimein interfaceSSLSession
-
setLastAccessedTime
public void setLastAccessedTime(long time) Description copied from interface:OpenSslInternalSessionSet the last access time which will be returned bySSLSession.getLastAccessedTime().- Specified by:
setLastAccessedTimein interfaceOpenSslInternalSession- Parameters:
time- the time
-
invalidate
public final void invalidate()- Specified by:
invalidatein interfaceSSLSession
-
isValid
public final boolean isValid()- Specified by:
isValidin interfaceSSLSession
-
putValue
- Specified by:
putValuein interfaceSSLSession
-
getValue
- Specified by:
getValuein interfaceSSLSession
-
removeValue
- Specified by:
removeValuein interfaceSSLSession
-
getValueNames
- Specified by:
getValueNamesin interfaceSSLSession
-
getPeerCertificates
- Specified by:
getPeerCertificatesin interfaceSSLSession- Throws:
SSLPeerUnverifiedException
-
hasPeerCertificates
public boolean hasPeerCertificates()Description copied from interface:OpenSslSessionReturns true if the peer has provided certificates during the handshake.This method is similar to
SSLSession.getPeerCertificates()but it does not throw aSSLPeerUnverifiedExceptionif no certs are provided, making it more efficient to check if a mTLS connection is used.- Specified by:
hasPeerCertificatesin interfaceOpenSslSession- Returns:
- true if peer certificates are available.
-
getLocalCertificates
- Specified by:
getLocalCertificatesin interfaceSSLSession
-
getPeerCertificateChain
- Specified by:
getPeerCertificateChainin interfaceSSLSession- Throws:
SSLPeerUnverifiedException
-
getPeerPrincipal
- Specified by:
getPeerPrincipalin interfaceSSLSession- Throws:
SSLPeerUnverifiedException
-
getLocalPrincipal
- Specified by:
getLocalPrincipalin interfaceSSLSession
-
getCipherSuite
- Specified by:
getCipherSuitein interfaceSSLSession
-
getProtocol
- Specified by:
getProtocolin interfaceSSLSession
-
getPeerHost
- Specified by:
getPeerHostin interfaceSSLSession
-
getPeerPort
public final int getPeerPort()- Specified by:
getPeerPortin interfaceSSLSession
-
getPacketBufferSize
public final int getPacketBufferSize()- Specified by:
getPacketBufferSizein interfaceSSLSession
-
getApplicationBufferSize
public final int getApplicationBufferSize()- Specified by:
getApplicationBufferSizein interfaceSSLSession
-
handshakeFinished
public void handshakeFinished(byte[] id, String cipher, String protocol, byte[] peerCertificate, byte[][] peerCertificateChain, long creationTime, long timeout) throws SSLException Description copied from interface:OpenSslInternalSessionCalled once the handshake has completed.- Specified by:
handshakeFinishedin interfaceOpenSslInternalSession- Throws:
SSLException
-
equals
-
hashCode
-
toString
-