Interface SslConfig
- All Known Subinterfaces:
ClientSslConfig,ServerSslConfig
- All Known Implementing Classes:
DelegatingClientSslConfig,DelegatingServerSslConfig,DelegatingSslConfig
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumDefines filtering logic for ciphers suites. -
Method Summary
Modifier and TypeMethodDescriptionGet the TLS ALPN protocols.default List<CertificateCompressionAlgorithm>Get the list of usableCertificateCompressionAlgorithmsto advertise.ciphers()Get the cipher suites to enable, in the order of preference.default SslConfig.CipherSuiteFilterDefines filtering behavior for ciphers suites.default DurationGet the timeout for the handshake process.Get aInputStreamwhich providesX.509certificate chain inPEMformat associated withkeySupplier().Get theKeyManagerFactoryto use for the SSL/TLS handshake.Get the password required to access the key material (e.g.Get aInputStreamwhich provides aPKCS#8private key inPEMformat associated withkeyCertChainSupplier().default intGet the preferred maximum allowed size of the certificate chain in bytes.provider()Get theSslProviderto use.longGet the size of the cache used for storing SSL session objects.longGet the timeout for the cached SSL session objects, in seconds.default SSLContextGet the javaxSSLContextto use for transport security.Get the TLS protocols to enable, in the order of preference.Get the trusted certificates for verifying the remote endpoint's certificate.Get theTrustManagerFactoryused for verifying the remote endpoint's certificate.
-
Method Details
-
sslContext
Get the javaxSSLContextto use for transport security.If this method return a non-null value, only the
SslProvider.JDKprovider will be used and the following methods will be ignored:- Returns:
- the javax
SSLContextto use for transport security.
-
trustManagerFactory
Get theTrustManagerFactoryused for verifying the remote endpoint's certificate.- Returns:
- the
TrustManagerFactoryused for verifying the remote endpoint's certificate.
-
trustCertChainSupplier
Get the trusted certificates for verifying the remote endpoint's certificate. The input stream should contain anX.509certificate chain inPEMformat.- Returns:
- the trusted certificates for verifying the remote endpoint's certificate. The input stream should
contain an
X.509certificate chain inPEMformat.Each invocation of the
Suppliershould provide an independent instance ofInputStreamand the caller is responsible for invokingInputStream.close().
-
keyManagerFactory
Get theKeyManagerFactoryto use for the SSL/TLS handshake.- Returns:
- the
KeyManagerFactoryto use for the SSL/TLS handshake.
-
keyCertChainSupplier
Get aInputStreamwhich providesX.509certificate chain inPEMformat associated withkeySupplier().- Returns:
- the certificate chain associated with
keySupplier().Each invocation of the
Suppliershould provide an independent instance ofInputStreamand the caller is responsible for invokingInputStream.close().
-
keySupplier
Get aInputStreamwhich provides aPKCS#8private key inPEMformat associated withkeyCertChainSupplier().- Returns:
- a
InputStreamwhich provides aPKCS#8private key inPEMformat associated withkeyCertChainSupplier().Each invocation of the
Suppliershould provide an independent instance ofInputStreamand the caller is responsible for invokingInputStream.close().
-
keyPassword
Get the password required to access the key material (e.g. fromkeySupplier()).- Returns:
- the password required to access the key material (e.g. from
keySupplier()).
-
sslProtocols
Get the TLS protocols to enable, in the order of preference.- Returns:
- the TLS protocols to enable, in the order of preference.
- See Also:
-
alpnProtocols
Get the TLS ALPN protocols.Note that each ALPN protocol typically requires corresponding configuration at the protocol layer and as a result maybe inferred and overridden by the protocol layer.
- Returns:
- the TLS ALPN protocols.
-
ciphers
Get the cipher suites to enable, in the order of preference.- Returns:
- the cipher suites to enable, in the order of preference.
- See Also:
-
cipherSuiteFilter
Defines filtering behavior for ciphers suites.- Returns:
- filtering behavior for ciphers suites.
- See Also:
-
sessionCacheSize
long sessionCacheSize()Get the size of the cache used for storing SSL session objects.- Returns:
- the size of the cache used for storing SSL session objects.
- See Also:
-
sessionTimeout
long sessionTimeout()Get the timeout for the cached SSL session objects, in seconds.- Returns:
- the timeout for the cached SSL session objects, in seconds.
- See Also:
-
provider
Get theSslProviderto use.- Returns:
- the
SslProviderto use.
-
certificateCompressionAlgorithms
Get the list of usableCertificateCompressionAlgorithmsto advertise.If this method returns null (by default) or an empty list, no certificate compression algorithms will be advertised during the TLS handshake which effectively disables this feature. Note that even though they are advertised, the other side is not required per RFC to compress so certificates might still be sent uncompressed.
Also note that this feature is only available with:
- BoringSSL implementation of
SslProvider.OPENSSL. Provided compression algorithms are ignored when theSslProvider.JDKis used. - TLSv1.3 or above.
- Returns:
- the list of certificate compression algorithms to advertise.
- See Also:
- BoringSSL implementation of
-
handshakeTimeout
Get the timeout for the handshake process.Implementations can round the returned
Durationto full time units, depending on their time granularity.Zero durationdisables the timeout.- Returns:
- the timeout for the handshake process or
Duration.ZEROto disable it.
-
maxCertificateListBytes
default int maxCertificateListBytes()Get the preferred maximum allowed size of the certificate chain in bytes. This may not be respected and depends on if theSSLEnginesupports this feature.- Returns:
- Maximum number of bytes for the certificate chain, or
<=0to use the default limit.
-