Package net.dona.doip.util.tls

# Class TlsProtocolAndCipherSuiteConfigurationUtil

java.lang.Object
net.dona.doip.util.tls.TlsProtocolAndCipherSuiteConfigurationUtil

public class TlsProtocolAndCipherSuiteConfigurationUtil extends Object
Utilities for restricting TLS connections to use appropriate protocol versions and cipher suites.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `TlsProtocolAndCipherSuiteConfigurationUtil.ServerSocketFactoryWrapper`
  A wrapper for an `SSLServerSocketFactory` which ensures that all created server sockets will use appropriate protocols and cipher suites.
  `static class`
  `TlsProtocolAndCipherSuiteConfigurationUtil.SocketFactoryWrapper`
  A wrapper for an `SSLSocketFactory` which ensures that all created sockets will use appropriate protocols and cipher suites.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String[]`
  `ENABLED_CIPHER_SUITES`
  A list of TLS cipher suites both provided by the JVM and considered sufficiently strong.
  `static final String[]`
  `ENABLED_PROTOCOLS`
  A list of TLS protocols both provided by the JVM and considered sufficiently strong.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TlsProtocolAndCipherSuiteConfigurationUtil()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static ServerSocket`
  `configureEnabledProtocolsAndCipherSuites(ServerSocket s)`
  Configures an `SSLServerSocket` to use the appropriate protocols and cipher suites.
  `static Socket`
  `configureEnabledProtocolsAndCipherSuites(Socket s)`
  Configures an `SSLSocket` to use the appropriate protocols and cipher suites.
  `static SSLContext`
  `getAllTrustingClientSSLContext()`
  Returns an `SSLContext` which trusts all server certificates.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### ENABLED_PROTOCOLS

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

  - ### ENABLED_CIPHER_SUITES

    public static final String[] 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

    public static Socket configureEnabledProtocolsAndCipherSuites(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 ServerSocket configureEnabledProtocolsAndCipherSuites(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 SSLContext getAllTrustingClientSSLContext()
    Returns an `SSLContext` which trusts all server certificates.
    Returns:
      an `SSLContext` which trusts all server certificates