Class SessionIdContextBuilder
session_id_context for a server context from the material that determines which clients
it accepts.
The session discriminating material is the ClientAuth mode, the certificate chain it presents,
the certificates it trusts, and any installed credentials.
The session_id_context scopes session resumption: a session (and therefore its client-authentication
state) can only be resumed by a context that uses the same session_id_context. It must hence differ
between contexts which, when sharing a session cache or session-ticket keys, must not accept each others
sessions (for example because they use a different ClientAuth mode or trust configuration), but it
should be the same for contexts that are configured identically (for example on different nodes of a cluster
that share session-ticket keys), so resumption keeps working between them.
See
SSL_CTX_set_session_id_context and
GHSA-6xv6-9mgg-mfvc.
This class securely computes distinct session context identifiers from the discriminating material, such that resumption is allowed for connections to the same JVM, with optional support for deterministic cross-JVM session context ids.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]build()static SessionIdContextBuildersetClientAuth(ClientAuth clientAuth) setCredentials(OpenSslCredential[] credentials) setKeyCertificateChain(X509Certificate[] chain) Use the given certificate chain as the local identity material.setKeyManager(KeyManager keyManager) Use the identity of the givenKeyManageras the local identity material.setKeyManagerFactory(KeyManagerFactory keyManagerFactory) Use the identity of the givenKeyManagerFactoryas the local identity material.setSeed(byte[] seed) setSessionIdContextOverride(byte[] override) setTrustedCertificates(X509Certificate[] trustedCertificates) Use the given certificates as the trust material.setTrustManager(TrustManager trustManager) Use the identity of the givenTrustManageras the trust material.setTrustManagerFactory(TrustManagerFactory trustManagerFactory) Use the identity of the givenTrustManagerFactoryas the trust material.
-
Constructor Details
-
SessionIdContextBuilder
-
-
Method Details
-
randomSessionIdContext
-
setSessionIdContextOverride
-
setSeed
-
setClientAuth
-
setCredentials
-
setKeyManager
Use the identity of the givenKeyManageras the local identity material.nullclears all local identity material. -
setKeyManagerFactory
Use the identity of the givenKeyManagerFactoryas the local identity material.nullclears all local identity material. -
setKeyCertificateChain
Use the given certificate chain as the local identity material. The private key is deliberately not part of the digest: the chain already identifies it, and digesting secret material would put a stable fingerprint of it into every session.nullclears all local identity material.The array is not copied, so the caller must not modify it afterwards.
-
setTrustManager
Use the identity of the givenTrustManageras the trust material.nullclears all trust material. -
setTrustManagerFactory
Use the identity of the givenTrustManagerFactoryas the trust material.nullclears all trust material. -
setTrustedCertificates
Use the given certificates as the trust material.nullclears all trust material.The array is not copied, so the caller must not modify it afterwards.
-
build
public byte[] build()
-