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 String
private long
private byte[]
private long
private X509Certificate[]
private X509Certificate[]
private byte[]
private X509Certificate[]
private String
private int
private byte[]
private String
private AbstractSessionContext
private final NativeSsl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
Throw SSLPeerUnverifiedException on null or empty peerCertificates arrayprivate void
configurePeer
(String peerHost, int peerPort, X509Certificate[] peerCertificates) int
long
byte[]
getId()
long
Returns the last time this SSL session was accessed.int
Returns the certificate(s) of the peer in this SSL session used in the handshaking phase of the connection.int
byte[]
Returns the signed certificate timestamp (SCT) received from the peer.List
<byte[]> Returns the OCSP stapled response.String[]
void
boolean
isValid()
(package private) void
onPeerCertificateAvailable
(String peerHost, int peerPort) Updates the cached peer certificate after the handshake has completed (or entered False Start).(package private) void
onPeerCertificatesReceived
(String peerHost, int peerPort, X509Certificate[] peerCertificates) Configures the peer information once it has been received by the handshake.void
void
removeValue
(String name) (package private) void
setLastAccessedTime
(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:
getId
in interfaceSSLSession
-
getSessionContext
- Specified by:
getSessionContext
in interfaceSSLSession
-
getCreationTime
public long getCreationTime()- Specified by:
getCreationTime
in 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:
getLastAccessedTime
in 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:
getStatusResponses
in 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:
getPeerSignedCertificateTimestamp
in interfaceConscryptSession
- See Also:
-
getRequestedServerName
- Specified by:
getRequestedServerName
in interfaceConscryptSession
-
invalidate
public void invalidate()- Specified by:
invalidate
in interfaceSSLSession
-
isValid
public boolean isValid()- Specified by:
isValid
in interfaceSSLSession
-
putValue
- Specified by:
putValue
in interfaceSSLSession
-
getValue
- Specified by:
getValue
in interfaceSSLSession
-
removeValue
- Specified by:
removeValue
in interfaceSSLSession
-
getValueNames
- Specified by:
getValueNames
in interfaceSSLSession
-
getPeerCertificates
- Specified by:
getPeerCertificates
in interfaceConscryptSession
- Specified by:
getPeerCertificates
in interfaceSSLSession
- Throws:
SSLPeerUnverifiedException
-
getLocalCertificates
- Specified by:
getLocalCertificates
in 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:
getPeerCertificateChain
in 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:
getPeerPrincipal
in interfaceSSLSession
- Throws:
SSLPeerUnverifiedException
-
getLocalPrincipal
- Specified by:
getLocalPrincipal
in interfaceSSLSession
-
getCipherSuite
- Specified by:
getCipherSuite
in interfaceSSLSession
-
getProtocol
- Specified by:
getProtocol
in interfaceSSLSession
-
getPeerHost
- Specified by:
getPeerHost
in interfaceSSLSession
-
getPeerPort
public int getPeerPort()- Specified by:
getPeerPort
in interfaceSSLSession
-
getPacketBufferSize
public int getPacketBufferSize()- Specified by:
getPacketBufferSize
in interfaceSSLSession
-
getApplicationBufferSize
public int getApplicationBufferSize()- Specified by:
getApplicationBufferSize
in interfaceSSLSession
-
getApplicationProtocol
- Specified by:
getApplicationProtocol
in 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
-