SSLUtil (Apache Tomcat 8.5.87 API Documentation)

Package org.apache.tomcat.util.net

## Interface SSLUtil

- All Known Implementing Classes:
    `JSSEUtil`, `OpenSSLUtil`, `SSLUtilBase`

      public interface SSLUtil

  Provides a common interface for `SSLImplementation`s to create the necessary JSSE implementation objects for TLS connections created via the JSSE API.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static interface` | `SSLUtil.ProtocolInfo` | Optional interface that can be implemented by `SSLEngine`s to indicate that they support ALPN and can provided the protocol agreed with the client.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `configureSessionContext​(javax.net.ssl.SSLSessionContext sslSessionContext)` |
    `SSLContext` | `createSSLContext​(java.util.List<java.lang.String> negotiableProtocols)` |
    `java.lang.String[]` | `getEnabledCiphers()` | The set of enabled ciphers is the intersection of the implemented ciphers and the configured ciphers.
    `java.lang.String[]` | `getEnabledProtocols()` | The set of enabled protocols is the intersection of the implemented protocols and the configured protocols.
    `javax.net.ssl.KeyManager[]` | `getKeyManagers()` |
    `javax.net.ssl.TrustManager[]` | `getTrustManagers()` |

- - ### Method Detail

    - #### createSSLContext

          SSLContext createSSLContext​(java.util.List<java.lang.String> negotiableProtocols)
                               throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### getKeyManagers

          javax.net.ssl.KeyManager[] getKeyManagers()
                                             throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### getTrustManagers

          javax.net.ssl.TrustManager[] getTrustManagers()
                                                 throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### configureSessionContext

          void configureSessionContext​(javax.net.ssl.SSLSessionContext sslSessionContext)

    - #### getEnabledProtocols

          java.lang.String[] getEnabledProtocols()
                                          throws java.lang.IllegalArgumentException

      The set of enabled protocols is the intersection of the implemented protocols and the configured protocols. If no protocols are explicitly configured, then all of the implemented protocols will be included in the returned array.
      Returns:
        The protocols currently enabled and available for clients to select from for the associated connection
      Throws:
        `java.lang.IllegalArgumentException` - If there is no intersection between the implemented and configured protocols

    - #### getEnabledCiphers

          java.lang.String[] getEnabledCiphers()
                                        throws java.lang.IllegalArgumentException

      The set of enabled ciphers is the intersection of the implemented ciphers and the configured ciphers. If no ciphers are explicitly configured, then the default ciphers will be included in the returned array.

      The ciphers used during the TLS handshake may be further restricted by the `getEnabledProtocols()` and the certificates.

      Returns:
        The ciphers currently enabled and available for clients to select from for the associated connection
      Throws:
        `java.lang.IllegalArgumentException` - If there is no intersection between the implemented and configured ciphers