AprSSLSupport (Apache Tomcat 9.0.37 API Documentation)

org.apache.tomcat.util.net

## Class AprSSLSupport

- java.lang.Object
- - org.apache.tomcat.util.net.AprSSLSupport

- All Implemented Interfaces:
    SSLSupport

      public class AprSSLSupport
      extends Object
      implements SSLSupport

  Implementation of SSLSupport for APR.

  TODO: Add a mechanism (or figure out how to use what we already have) to invalidate the session.

- - ### Field Summary

    - ### Fields inherited from interface org.apache.tomcat.util.net.SSLSupport

      `CERTIFICATE_KEY, CIPHER_SUITE_KEY, KEY_SIZE_KEY, PROTOCOL_VERSION_KEY, SESSION_ID_KEY, SESSION_MGR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AprSSLSupport(AprEndpoint.AprSocketWrapper socketWrapper, String clientCertProvider)`

  - ### Method Summary

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

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

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

    - ### Methods inherited from interface org.apache.tomcat.util.net.SSLSupport

      `getLocalCertificateChain`

- - ### Constructor Detail

    - #### AprSSLSupport

          public AprSSLSupport(AprEndpoint.AprSocketWrapper socketWrapper,
                               String clientCertProvider)

  - ### Method Detail

    - #### getCipherSuite

          public String getCipherSuite()
                                throws IOException

      Description copied from interface: `SSLSupport`
      The cipher suite being used on this connection.
      Specified by:
        `getCipherSuite` in interface `SSLSupport`
      Returns:
        The name of the cipher suite as returned by the SSL/TLS implementation
      Throws:
        `IOException` - If an error occurs trying to obtain the cipher suite

    - #### getPeerCertificateChain

          public X509Certificate[] getPeerCertificateChain()
                                                    throws IOException

      Description copied from interface: `SSLSupport`
      The client certificate chain (if any).
      Specified by:
        `getPeerCertificateChain` in interface `SSLSupport`
      Returns:
        The certificate chain presented by the client with the peer's certificate first, followed by those of any certificate authorities
      Throws:
        `IOException` - If an error occurs trying to obtain the certificate chain

    - #### getKeySize

          public Integer getKeySize()
                             throws IOException

      Description copied from interface: `SSLSupport`
      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.
      Specified by:
        `getKeySize` in interface `SSLSupport`
      Returns:
        The effective key size for the current cipher suite
      Throws:
        `IOException` - If an error occurs trying to obtain the key size

    - #### getSessionId

          public String getSessionId()
                              throws IOException

      Description copied from interface: `SSLSupport`
      The current session Id.
      Specified by:
        `getSessionId` in interface `SSLSupport`
      Returns:
        The current SSL/TLS session ID
      Throws:
        `IOException` - If an error occurs trying to obtain the session ID

    - #### getProtocol

          public String getProtocol()
                             throws IOException

      Specified by:
        `getProtocol` in interface `SSLSupport`
      Returns:
        the protocol String indicating how the SSL socket was created e.g. TLSv1 or TLSv1.2 etc.
      Throws:
        `IOException` - If an error occurs trying to obtain the protocol information from the socket

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.