Package com.yahoo.security.tls
Interface TlsContext
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
ConfigFileBasedTlsContext,DefaultTlsContext
A simplified version of
SSLContext modelled as an interface.- Author:
- bjorncs
-
Field Summary
FieldsModifier and TypeFieldDescriptionHandpicked subset of supported ciphers from https://www.openssl.org/docs/manmaster/man1/ciphers.html based on Modern spec from https://wiki.mozilla.org/Security/Server_Side_TLS For TLSv1.2 we only allow RSA and ECDSA with ephemeral key exchange and GCM.static final StringSSLContextprotocol name that supports at least oldest protocol listed inALLOWED_PROTOCOLS -
Method Summary
Modifier and TypeMethodDescriptiondefault voidclose()default SSLSocketdefault SSLServerSocketdefault SSLEnginedefault SSLEnginecreateSslEngine(String peerHost, int peerPort) static SSLContextgetAllowedCipherSuites(SSLContext context) getAllowedProtocols(SSLContext context)
-
Field Details
-
ALLOWED_CIPHER_SUITES
Handpicked subset of supported ciphers from https://www.openssl.org/docs/manmaster/man1/ciphers.html based on Modern spec from https://wiki.mozilla.org/Security/Server_Side_TLS For TLSv1.2 we only allow RSA and ECDSA with ephemeral key exchange and GCM. For TLSv1.3 we allow the DEFAULT group ciphers. Note that we _only_ allow AEAD ciphers for either TLS version. -
ALLOWED_PROTOCOLS
-
SSL_CONTEXT_VERSION
SSLContextprotocol name that supports at least oldest protocol listed inALLOWED_PROTOCOLS
-
-
Method Details
-
getAllowedCipherSuites
- Returns:
- the allowed cipher suites supported by the provided context instance
-
getAllowedCipherSuites
-
getAllowedProtocols
- Returns:
- the allowed protocols supported by the provided context instance
-
getAllowedProtocols
-
defaultSslContext
- Returns:
- Default
SSLContextinstance without certificate and using JDK's default trust store
-
sslContext
X509SslContext sslContext() -
parameters
SSLParameters parameters() -
createSslEngine
-
createSslEngine
-
createClientSslSocket
- Throws:
IOException
-
createServerSslSocket
- Throws:
IOException
-
close
default void close()- Specified by:
closein interfaceAutoCloseable
-