Class TlsProtocolAndCipherSuiteConfigurationUtil


  • public class TlsProtocolAndCipherSuiteConfigurationUtil
    extends java.lang.Object
    Utilities for restricting TLS connections to use appropriate protocol versions and cipher suites.
    • Field Detail

      • ENABLED_PROTOCOLS

        public static final java.lang.String[] ENABLED_PROTOCOLS
        A list of TLS protocols both provided by the JVM and considered sufficiently strong.
      • ENABLED_CIPHER_SUITES

        public static final java.lang.String[] ENABLED_CIPHER_SUITES
        A list of TLS cipher suites both provided by the JVM and considered sufficiently strong.
    • Constructor Detail

      • TlsProtocolAndCipherSuiteConfigurationUtil

        public TlsProtocolAndCipherSuiteConfigurationUtil()
    • Method Detail

      • configureEnabledProtocolsAndCipherSuites

        public static java.net.Socket configureEnabledProtocolsAndCipherSuites​(java.net.Socket s)
        Configures an SSLSocket to use the appropriate protocols and cipher suites. If the input is not an SSLSocket no action is taken.
        Parameters:
        s - a Socket
        Returns:
        the input Socket
      • configureEnabledProtocolsAndCipherSuites

        public static java.net.ServerSocket configureEnabledProtocolsAndCipherSuites​(java.net.ServerSocket s)
        Configures an SSLServerSocket to use the appropriate protocols and cipher suites. If the input is not an SSLServerSocket no action is taken.
        Parameters:
        s - a ServerSocket
        Returns:
        the input ServerSocket
      • getAllTrustingClientSSLContext

        public static javax.net.ssl.SSLContext getAllTrustingClientSSLContext()
        Returns an SSLContext which trusts all server certificates.
        Returns:
        an SSLContext which trusts all server certificates