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

org.apache.zookeeper.common

## Class SSLContextAndOptions

- java.lang.Object
- - org.apache.zookeeper.common.SSLContextAndOptions

-     public class SSLContextAndOptions
      extends Object

  Wrapper class for an SSLContext + some config options that can't be set on the context when it is created but must be set on a secure socket created by the context after the socket creation. By wrapping the options in this class we avoid reading from global system properties during socket configuration. This makes testing easier since we can create different X509Util instances with different configurations in a single test process, and unit test interactions between them.

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `io.netty.handler.ssl.SslContext` | `createNettyJdkSslContext(SSLContext sslContext, boolean isClientSocket)`
    `SSLServerSocket` | `createSSLServerSocket()`
    `SSLServerSocket` | `createSSLServerSocket(int port)`
    `SSLSocket` | `createSSLSocket()`
    `SSLSocket` | `createSSLSocket(Socket socket, byte[] pushbackBytes)`
    `int` | `getHandshakeDetectionTimeoutMillis()`
    `SSLContext` | `getSSLContext()`

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

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

- - ### Method Detail

    - #### getSSLContext

          public SSLContext getSSLContext()

    - #### createSSLSocket

          public SSLSocket createSSLSocket()
                                    throws IOException

      Throws:
        `IOException`

    - #### createSSLSocket

          public SSLSocket createSSLSocket(Socket socket,
                                           byte[] pushbackBytes)
                                    throws IOException

      Throws:
        `IOException`

    - #### createSSLServerSocket

          public SSLServerSocket createSSLServerSocket()
                                                throws IOException

      Throws:
        `IOException`

    - #### createSSLServerSocket

          public SSLServerSocket createSSLServerSocket(int port)
                                                throws IOException

      Throws:
        `IOException`

    - #### createNettyJdkSslContext

          public io.netty.handler.ssl.SslContext createNettyJdkSslContext(SSLContext sslContext,
                                                                          boolean isClientSocket)

    - #### getHandshakeDetectionTimeoutMillis

          public int getHandshakeDetectionTimeoutMillis()

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