Class SslHandlerFactory

java.lang.Object
com.couchbase.client.core.io.netty.SslHandlerFactory

@Internal public class SslHandlerFactory extends Object
This factory creates SslHandler based on a given configuration.
Since:
2.0.0
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<String>
    defaultCiphers(boolean nativeTlsEnabled)
    Lists the default ciphers used for this platform.
    static com.couchbase.client.core.deps.io.netty.handler.ssl.SslHandler
    get(com.couchbase.client.core.deps.io.netty.buffer.ByteBufAllocator allocator, SecurityConfig config, EndpointContext endpointContext)
     
    static boolean
    True if the native ssl transport is available, false otherwise.
    static com.couchbase.client.core.deps.io.netty.handler.ssl.SslProvider
    sslProvider(boolean nativeTlsEnabled)
    Returns the TLS provider to use: native (OpenSSL) if it's enabled and available, otherwise JDK.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SslHandlerFactory

      public SslHandlerFactory()
  • Method Details

    • get

      public static com.couchbase.client.core.deps.io.netty.handler.ssl.SslHandler get(com.couchbase.client.core.deps.io.netty.buffer.ByteBufAllocator allocator, SecurityConfig config, EndpointContext endpointContext) throws Exception
      Throws:
      Exception
    • sslProvider

      @Internal public static com.couchbase.client.core.deps.io.netty.handler.ssl.SslProvider sslProvider(boolean nativeTlsEnabled)
      Returns the TLS provider to use: native (OpenSSL) if it's enabled and available, otherwise JDK.

      Doesn't load the native library unless native TLS is enabled.

      Parameters:
      nativeTlsEnabled - if native TLS is enabled on the security configuration.
    • opensslAvailable

      @Internal public static boolean opensslAvailable()
      True if the native ssl transport is available, false otherwise.
    • defaultCiphers

      @Internal public static List<String> defaultCiphers(boolean nativeTlsEnabled)
      Lists the default ciphers used for this platform.

      Note that the list of ciphers can differ whether native TLS is enabled or not, so the parameter should reflect the actual security configuration used. Native TLS is enabled by default on the configuration, so if it is not overridden it should be set to true here as well.

      Parameters:
      nativeTlsEnabled - if native TLS is enabled on the security configuration (defaults to yes there).
      Returns:
      the list of default ciphers.