ZKTrustManager (Apache ZooKeeper - Server 3.7.0 API)
Date: 2021-03-17

org.apache.zookeeper.common

## Class ZKTrustManager

- java.lang.Object
- - javax.net.ssl.X509ExtendedTrustManager
  - - org.apache.zookeeper.common.ZKTrustManager

- All Implemented Interfaces:
    TrustManager, X509TrustManager

      public class ZKTrustManager
      extends X509ExtendedTrustManager

  A custom TrustManager that supports hostname verification via org.apache.http.conn.ssl.DefaultHostnameVerifier. We attempt to perform verification using just the IP address first and if that fails will attempt to perform a reverse DNS lookup and verify using the hostname.

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `checkClientTrusted(X509Certificate[] chain, String authType)`
    `void` | `checkClientTrusted(X509Certificate[] chain, String authType, Socket socket)`
    `void` | `checkClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine)`
    `void` | `checkServerTrusted(X509Certificate[] chain, String authType)`
    `void` | `checkServerTrusted(X509Certificate[] chain, String authType, Socket socket)`
    `void` | `checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine)`
    `X509Certificate[]` | `getAcceptedIssuers()`

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

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

- - ### Method Detail

    - #### getAcceptedIssuers

          public X509Certificate[] getAcceptedIssuers()

    - #### checkClientTrusted

          public void checkClientTrusted(X509Certificate[] chain,
                                         String authType,
                                         Socket socket)
                                  throws CertificateException

      Specified by:
        `checkClientTrusted` in class `X509ExtendedTrustManager`
      Throws:
        `CertificateException`

    - #### checkServerTrusted

          public void checkServerTrusted(X509Certificate[] chain,
                                         String authType,
                                         Socket socket)
                                  throws CertificateException

      Specified by:
        `checkServerTrusted` in class `X509ExtendedTrustManager`
      Throws:
        `CertificateException`

    - #### checkClientTrusted

          public void checkClientTrusted(X509Certificate[] chain,
                                         String authType,
                                         SSLEngine engine)
                                  throws CertificateException

      Specified by:
        `checkClientTrusted` in class `X509ExtendedTrustManager`
      Throws:
        `CertificateException`

    - #### checkServerTrusted

          public void checkServerTrusted(X509Certificate[] chain,
                                         String authType,
                                         SSLEngine engine)
                                  throws CertificateException

      Specified by:
        `checkServerTrusted` in class `X509ExtendedTrustManager`
      Throws:
        `CertificateException`

    - #### checkClientTrusted

          public void checkClientTrusted(X509Certificate[] chain,
                                         String authType)
                                  throws CertificateException

      Throws:
        `CertificateException`

    - #### checkServerTrusted

          public void checkServerTrusted(X509Certificate[] chain,
                                         String authType)
                                  throws CertificateException

      Throws:
        `CertificateException`

Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.