Package org.conscrypt
Class ActiveSession
java.lang.Object
org.conscrypt.ActiveSession
- All Implemented Interfaces:
SSLSession,ConscryptSession
A session that is dedicated a single connection and operates directly on the underlying
SSL.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate longprivate byte[]private longprivate X509Certificate[]private X509Certificate[]private byte[]private X509Certificate[]private Stringprivate intprivate byte[]private Stringprivate AbstractSessionContextprivate final NativeSsl -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidThrow SSLPeerUnverifiedException on null or empty peerCertificates arrayprivate voidconfigurePeer(String peerHost, int peerPort, X509Certificate[] peerCertificates) intlongbyte[]getId()longReturns the last time this SSL session was accessed.intReturns the certificate(s) of the peer in this SSL session used in the handshaking phase of the connection.intbyte[]Returns the signed certificate timestamp (SCT) received from the peer.List<byte[]> Returns the OCSP stapled response.String[]voidbooleanisValid()(package private) voidonPeerCertificateAvailable(String peerHost, int peerPort) Updates the cached peer certificate after the handshake has completed (or entered False Start).(package private) voidonPeerCertificatesReceived(String peerHost, int peerPort, X509Certificate[] peerCertificates) Configures the peer information once it has been received by the handshake.voidvoidremoveValue(String name) (package private) voidsetLastAccessedTime(long accessTimeMillis)
-
Field Details
-
ssl
-
sessionContext
-
id
private byte[] id -
creationTime
private long creationTime -
protocol
-
applicationProtocol
-
peerHost
-
peerPort
private int peerPort -
lastAccessedTime
private long lastAccessedTime -
peerCertificateChain
-
localCertificates
-
peerCertificates
-
peerCertificateOcspData
private byte[] peerCertificateOcspData -
peerTlsSctData
private byte[] peerTlsSctData
-
-
Constructor Details
-
ActiveSession
ActiveSession(NativeSsl ssl, AbstractSessionContext sessionContext)
-
-
Method Details
-
getId
public byte[] getId()- Specified by:
getIdin interfaceSSLSession
-
getSessionContext
- Specified by:
getSessionContextin interfaceSSLSession
-
getCreationTime
public long getCreationTime()- Specified by:
getCreationTimein interfaceSSLSession
-
getLastAccessedTime
public long getLastAccessedTime()Returns the last time this SSL session was accessed. Accessing here is to mean that a new connection with the same SSL context data was established.- Specified by:
getLastAccessedTimein interfaceSSLSession- Returns:
- the session's last access time in milliseconds since the epoch
-
setLastAccessedTime
void setLastAccessedTime(long accessTimeMillis) -
getStatusResponses
Returns the OCSP stapled response. Returns a copy of the internal arrays. The method signature matches Java 9.- Specified by:
getStatusResponsesin interfaceConscryptSession- See Also:
-
getPeerSignedCertificateTimestamp
public byte[] getPeerSignedCertificateTimestamp()Returns the signed certificate timestamp (SCT) received from the peer. Returns a copy of the internal array.- Specified by:
getPeerSignedCertificateTimestampin interfaceConscryptSession- See Also:
-
getRequestedServerName
- Specified by:
getRequestedServerNamein interfaceConscryptSession
-
invalidate
public void invalidate()- Specified by:
invalidatein interfaceSSLSession
-
isValid
public 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 interfaceConscryptSession- Specified by:
getPeerCertificatesin interfaceSSLSession- Throws:
SSLPeerUnverifiedException
-
getLocalCertificates
- Specified by:
getLocalCertificatesin interfaceSSLSession
-
getPeerCertificateChain
Returns the certificate(s) of the peer in this SSL session used in the handshaking phase of the connection. Please notice hat this method is superseded bygetPeerCertificates().- Specified by:
getPeerCertificateChainin interfaceSSLSession- Returns:
- an array of X509 certificates (the peer's one first and then eventually that of the certification authority) or null if no certificate were used during the SSL connection.
- Throws:
SSLPeerUnverifiedException- if either a non-X.509 certificate was used (i.e. Kerberos certificates) or the peer could not be verified.
-
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 int getPeerPort()- Specified by:
getPeerPortin interfaceSSLSession
-
getPacketBufferSize
public int getPacketBufferSize()- Specified by:
getPacketBufferSizein interfaceSSLSession
-
getApplicationBufferSize
public int getApplicationBufferSize()- Specified by:
getApplicationBufferSizein interfaceSSLSession
-
getApplicationProtocol
- Specified by:
getApplicationProtocolin interfaceConscryptSession
-
onPeerCertificatesReceived
Configures the peer information once it has been received by the handshake. -
configurePeer
-
onPeerCertificateAvailable
Updates the cached peer certificate after the handshake has completed (or entered False Start).- Throws:
CertificateException
-
checkPeerCertificatesPresent
Throw SSLPeerUnverifiedException on null or empty peerCertificates array- Throws:
SSLPeerUnverifiedException
-