Package net.dona.doip.util.tls
Class TlsProtocolAndCipherSuiteConfigurationUtil
java.lang.Object
net.dona.doip.util.tls.TlsProtocolAndCipherSuiteConfigurationUtil
Utilities for restricting TLS connections to use appropriate protocol versions and cipher suites.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA wrapper for anSSLServerSocketFactorywhich ensures that all created server sockets will use appropriate protocols and cipher suites.static classA wrapper for anSSLSocketFactorywhich ensures that all created sockets will use appropriate protocols and cipher suites. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ServerSocketConfigures anSSLServerSocketto use the appropriate protocols and cipher suites.static SocketConfigures anSSLSocketto use the appropriate protocols and cipher suites.static SSLContextReturns anSSLContextwhich trusts all server certificates.
-
Field Details
-
ENABLED_PROTOCOLS
A list of TLS protocols both provided by the JVM and considered sufficiently strong. -
ENABLED_CIPHER_SUITES
A list of TLS cipher suites both provided by the JVM and considered sufficiently strong.
-
-
Constructor Details
-
TlsProtocolAndCipherSuiteConfigurationUtil
public TlsProtocolAndCipherSuiteConfigurationUtil()
-
-
Method Details
-
configureEnabledProtocolsAndCipherSuites
Configures anSSLSocketto use the appropriate protocols and cipher suites. If the input is not anSSLSocketno action is taken.- Parameters:
s- aSocket- Returns:
- the input
Socket
-
configureEnabledProtocolsAndCipherSuites
Configures anSSLServerSocketto use the appropriate protocols and cipher suites. If the input is not anSSLServerSocketno action is taken.- Parameters:
s- aServerSocket- Returns:
- the input
ServerSocket
-
getAllTrustingClientSSLContext
Returns anSSLContextwhich trusts all server certificates.- Returns:
- an
SSLContextwhich trusts all server certificates
-