Class ExtendedOpenSslSession
java.lang.Object
javax.net.ssl.ExtendedSSLSession
io.netty.handler.ssl.ExtendedOpenSslSession
- All Implemented Interfaces:
OpenSslInternalSession, OpenSslSession, javax.net.ssl.SSLSession
abstract class ExtendedOpenSslSession
extends javax.net.ssl.ExtendedSSLSession
implements OpenSslInternalSession
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 java.lang.String[]private final OpenSslInternalSession -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanequals(java.lang.Object o) final intfinal java.lang.Stringfinal longfinal byte[]getId()final longfinal java.security.cert.Certificate[]final java.security.Principalfinal java.lang.String[]java.lang.StringReturns the used named group ornullif none was used or if it can't be determined.final intfinal javax.security.cert.X509Certificate[]final java.security.cert.Certificate[]final java.lang.Stringfinal intfinal java.security.Principaljava.lang.String[]java.lang.Stringabstract java.util.List<javax.net.ssl.SNIServerName> final OpenSslSessionContextjava.util.List<byte[]> final java.lang.ObjectgetValue(java.lang.String s) final java.lang.String[]voidhandshakeFinished(byte[] id, java.lang.String cipher, java.lang.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()java.util.Map<java.lang.String, java.lang.Object> 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 voidputValue(java.lang.String name, java.lang.Object value) final voidremoveValue(java.lang.String s) Return theOpenSslSessionIdthat can be used to identify this session.voidsetLastAccessedTime(long time) Set the last access time which will be returned bySSLSession.getLastAccessedTime().final voidsetLocalCertificate(java.security.cert.Certificate[] localCertificate) Set the local certificate chain that is used.voidsetSessionDetails(long creationTime, long lastAccessedTime, OpenSslSessionId id, java.util.Map<java.lang.String, java.lang.Object> keyValueStorage) Set the details for the session which might come from a cache.java.lang.StringtoString()final voidtryExpandApplicationBufferSize(int packetLengthDataOnly) Expand (or increase) the value returned bySSLSession.getApplicationBufferSize()if necessary.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Field Details
-
LOCAL_SUPPORTED_SIGNATURE_ALGORITHMS
private static final java.lang.String[] LOCAL_SUPPORTED_SIGNATURE_ALGORITHMS -
wrapped
-
-
Constructor Details
-
ExtendedOpenSslSession
ExtendedOpenSslSession(OpenSslInternalSession wrapped)
-
-
Method Details
-
getRequestedServerNames
public abstract java.util.List<javax.net.ssl.SNIServerName> getRequestedServerNames()- Overrides:
getRequestedServerNamesin classjavax.net.ssl.ExtendedSSLSession
-
getStatusResponses
public java.util.List<byte[]> 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
public java.util.Map<java.lang.String, java.lang.Object> 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, java.util.Map<java.lang.String, java.lang.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
public final void setLocalCertificate(java.security.cert.Certificate[] localCertificate) 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
public java.lang.String[] getPeerSupportedSignatureAlgorithms()- Specified by:
getPeerSupportedSignatureAlgorithmsin classjavax.net.ssl.ExtendedSSLSession
-
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
public final java.lang.String[] getLocalSupportedSignatureAlgorithms()- Specified by:
getLocalSupportedSignatureAlgorithmsin classjavax.net.ssl.ExtendedSSLSession
-
getId
public final byte[] getId()- Specified by:
getIdin interfacejavax.net.ssl.SSLSession
-
getSessionContext
- Specified by:
getSessionContextin interfaceOpenSslSession- Specified by:
getSessionContextin interfacejavax.net.ssl.SSLSession
-
getCreationTime
public final long getCreationTime()- Specified by:
getCreationTimein interfacejavax.net.ssl.SSLSession
-
getLastAccessedTime
public final long getLastAccessedTime()- Specified by:
getLastAccessedTimein interfacejavax.net.ssl.SSLSession
-
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 interfacejavax.net.ssl.SSLSession
-
isValid
public final boolean isValid()- Specified by:
isValidin interfacejavax.net.ssl.SSLSession
-
putValue
public final void putValue(java.lang.String name, java.lang.Object value) - Specified by:
putValuein interfacejavax.net.ssl.SSLSession
-
getValue
public final java.lang.Object getValue(java.lang.String s) - Specified by:
getValuein interfacejavax.net.ssl.SSLSession
-
removeValue
public final void removeValue(java.lang.String s) - Specified by:
removeValuein interfacejavax.net.ssl.SSLSession
-
getValueNames
public final java.lang.String[] getValueNames()- Specified by:
getValueNamesin interfacejavax.net.ssl.SSLSession
-
getPeerCertificates
public final java.security.cert.Certificate[] getPeerCertificates() throws javax.net.ssl.SSLPeerUnverifiedException- Specified by:
getPeerCertificatesin interfacejavax.net.ssl.SSLSession- Throws:
javax.net.ssl.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
public final java.security.cert.Certificate[] getLocalCertificates()- Specified by:
getLocalCertificatesin interfacejavax.net.ssl.SSLSession
-
getPeerCertificateChain
public final javax.security.cert.X509Certificate[] getPeerCertificateChain() throws javax.net.ssl.SSLPeerUnverifiedException- Specified by:
getPeerCertificateChainin interfacejavax.net.ssl.SSLSession- Throws:
javax.net.ssl.SSLPeerUnverifiedException
-
getPeerPrincipal
public final java.security.Principal getPeerPrincipal() throws javax.net.ssl.SSLPeerUnverifiedException- Specified by:
getPeerPrincipalin interfacejavax.net.ssl.SSLSession- Throws:
javax.net.ssl.SSLPeerUnverifiedException
-
getLocalPrincipal
public final java.security.Principal getLocalPrincipal()- Specified by:
getLocalPrincipalin interfacejavax.net.ssl.SSLSession
-
getCipherSuite
public final java.lang.String getCipherSuite()- Specified by:
getCipherSuitein interfacejavax.net.ssl.SSLSession
-
getProtocol
public java.lang.String getProtocol()- Specified by:
getProtocolin interfacejavax.net.ssl.SSLSession
-
getPeerHost
public final java.lang.String getPeerHost()- Specified by:
getPeerHostin interfacejavax.net.ssl.SSLSession
-
getPeerPort
public final int getPeerPort()- Specified by:
getPeerPortin interfacejavax.net.ssl.SSLSession
-
getPacketBufferSize
public final int getPacketBufferSize()- Specified by:
getPacketBufferSizein interfacejavax.net.ssl.SSLSession
-
getApplicationBufferSize
public final int getApplicationBufferSize()- Specified by:
getApplicationBufferSizein interfacejavax.net.ssl.SSLSession
-
handshakeFinished
public void handshakeFinished(byte[] id, java.lang.String cipher, java.lang.String protocol, byte[] peerCertificate, byte[][] peerCertificateChain, long creationTime, long timeout) throws javax.net.ssl.SSLException Description copied from interface:OpenSslInternalSessionCalled once the handshake has completed.- Specified by:
handshakeFinishedin interfaceOpenSslInternalSession- Throws:
javax.net.ssl.SSLException
-
getNamedGroup
public java.lang.String getNamedGroup()Description copied from interface:OpenSslSessionReturns the used named group ornullif none was used or if it can't be determined.- Specified by:
getNamedGroupin interfaceOpenSslSession- Returns:
- the named group
-
equals
public boolean equals(java.lang.Object o) - Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-