Package org.apache.tomcat.util.net

## Interface SSLSupport

- All Known Implementing Classes:
    `AprSSLSupport`, `JSSESupport`

      public interface SSLSupport

  Defines an interface to interact with SSL sessions.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static java.lang.String` | `CERTIFICATE_KEY` | The Request attribute key for the client certificate chain.
    `static java.lang.String` | `CIPHER_SUITE_KEY` | The Request attribute key for the cipher suite.
    `static java.lang.String` | `KEY_SIZE_KEY` | The Request attribute key for the key size.
    `static java.lang.String` | `PROTOCOL_VERSION_KEY` | The request attribute key under which the String indicating the protocol that created the SSL socket is recorded - e.g.
    `static java.lang.String` | `REQUESTED_CIPHERS_KEY` | The request attribute key under which the String indicating the ciphers requested by the client are recorded.
    `static java.lang.String` | `REQUESTED_PROTOCOL_VERSIONS_KEY` | The request attribute key under which the String indicating the protocols requested by the client are recorded.
    `static java.lang.String` | `SESSION_ID_KEY` | The Request attribute key for the session id.
    `static java.lang.String` | `SESSION_MGR` | The request attribute key for the session manager.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.String` | `getCipherSuite()` | The cipher suite being used on this connection.
    `java.lang.Integer` | `getKeySize()` | Get the keysize.
    `java.security.cert.X509Certificate[]` | `getPeerCertificateChain()` | The client certificate chain (if any).
    `java.lang.String` | `getProtocol()` |
    `java.lang.String` | `getRequestedCiphers()` |
    `java.lang.String` | `getRequestedProtocols()` |
    `java.lang.String` | `getSessionId()` | The current session Id.

- - ### Field Detail

    - #### CIPHER_SUITE_KEY

          static final java.lang.String CIPHER_SUITE_KEY

      The Request attribute key for the cipher suite.
      See Also:
        Constant Field Values

    - #### KEY_SIZE_KEY

          static final java.lang.String KEY_SIZE_KEY

      The Request attribute key for the key size.
      See Also:
        Constant Field Values

    - #### CERTIFICATE_KEY

          static final java.lang.String CERTIFICATE_KEY

      The Request attribute key for the client certificate chain.
      See Also:
        Constant Field Values

    - #### SESSION_ID_KEY

          static final java.lang.String SESSION_ID_KEY

      The Request attribute key for the session id. This one is a Tomcat extension to the Servlet spec.
      See Also:
        Constant Field Values

    - #### SESSION_MGR

          static final java.lang.String SESSION_MGR

      The request attribute key for the session manager. This one is a Tomcat extension to the Servlet spec.
      See Also:
        Constant Field Values

    - #### PROTOCOL_VERSION_KEY

          static final java.lang.String PROTOCOL_VERSION_KEY

      The request attribute key under which the String indicating the protocol that created the SSL socket is recorded - e.g. TLSv1 or TLSv1.2 etc.
      See Also:
        Constant Field Values

    - #### REQUESTED_CIPHERS_KEY

          static final java.lang.String REQUESTED_CIPHERS_KEY

      The request attribute key under which the String indicating the ciphers requested by the client are recorded.
      See Also:
        Constant Field Values

    - #### REQUESTED_PROTOCOL_VERSIONS_KEY

          static final java.lang.String REQUESTED_PROTOCOL_VERSIONS_KEY

      The request attribute key under which the String indicating the protocols requested by the client are recorded.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getCipherSuite

          java.lang.String getCipherSuite()
                                   throws java.io.IOException

      The cipher suite being used on this connection.
      Returns:
        The name of the cipher suite as returned by the SSL/TLS implementation
      Throws:
        `java.io.IOException` - If an error occurs trying to obtain the cipher suite

    - #### getPeerCertificateChain

          java.security.cert.X509Certificate[] getPeerCertificateChain()
                                                                throws java.io.IOException

      The client certificate chain (if any).
      Returns:
        The certificate chain presented by the client with the peer's certificate first, followed by those of any certificate authorities
      Throws:
        `java.io.IOException` - If an error occurs trying to obtain the certificate chain

    - #### getKeySize

          java.lang.Integer getKeySize()
                                throws java.io.IOException

      Get the keysize. What we're supposed to put here is ill-defined by the Servlet spec (S 4.7 again). There are at least 4 potential values that might go here: (a) The size of the encryption key (b) The size of the MAC key (c) The size of the key-exchange key (d) The size of the signature key used by the server Unfortunately, all of these values are nonsensical.
      Returns:
        The effective key size for the current cipher suite
      Throws:
        `java.io.IOException` - If an error occurs trying to obtain the key size

    - #### getSessionId

          java.lang.String getSessionId()
                                 throws java.io.IOException

      The current session Id.
      Returns:
        The current SSL/TLS session ID
      Throws:
        `java.io.IOException` - If an error occurs trying to obtain the session ID

    - #### getProtocol

          java.lang.String getProtocol()
                                throws java.io.IOException

      Returns:
        the protocol String indicating how the SSL socket was created e.g. TLSv1 or TLSv1.2 etc.
      Throws:
        `java.io.IOException` - If an error occurs trying to obtain the protocol information from the socket

    - #### getRequestedProtocols

          java.lang.String getRequestedProtocols()
                                          throws java.io.IOException

      Returns:
        the list of SSL/TLS protocol versions requested by the client
      Throws:
        `java.io.IOException` - If an error occurs trying to obtain the client requested protocol information from the socket

    - #### getRequestedCiphers

          java.lang.String getRequestedCiphers()
                                        throws java.io.IOException

      Returns:
        the list of SSL/TLS ciphers requested by the client
      Throws:
        `java.io.IOException` - If an error occurs trying to obtain the client request cipher information from the socket