Home / Class/ OpenSsl Class — netty Architecture

OpenSsl Class — netty Architecture

Architecture documentation for the OpenSsl class in OpenSsl.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  ed038636_6deb_9fdb_0fd6_26635e25e0e6["OpenSsl"]
  593fe992_e3e1_fc5c_7e5e_89211f987c02["OpenSsl.java"]
  ed038636_6deb_9fdb_0fd6_26635e25e0e6 -->|defined in| 593fe992_e3e1_fc5c_7e5e_89211f987c02
  4c80a9b9_d3bd_4492_f102_5054f0e5347b["String()"]
  ed038636_6deb_9fdb_0fd6_26635e25e0e6 -->|method| 4c80a9b9_d3bd_4492_f102_5054f0e5347b
  2e88b937_b72d_320d_d633_7a9a345f8ba4["isSessionCacheSupported()"]
  ed038636_6deb_9fdb_0fd6_26635e25e0e6 -->|method| 2e88b937_b72d_320d_d633_7a9a345f8ba4
  3915c940_1e35_cb8b_e1a4_5e46f15f242d["X509Certificate()"]
  ed038636_6deb_9fdb_0fd6_26635e25e0e6 -->|method| 3915c940_1e35_cb8b_e1a4_5e46f15f242d
  cb597410_c956_291a_5df0_5715524da118["doesSupportOcsp()"]
  ed038636_6deb_9fdb_0fd6_26635e25e0e6 -->|method| cb597410_c956_291a_5df0_5715524da118
  ec953bb5_8bd4_4eb1_d6b7_ae732ff5f407["doesSupportProtocol()"]
  ed038636_6deb_9fdb_0fd6_26635e25e0e6 -->|method| ec953bb5_8bd4_4eb1_d6b7_ae732ff5f407
  79be9e3e_427d_2797_27cf_ea0babfbadb8["isAvailable()"]
  ed038636_6deb_9fdb_0fd6_26635e25e0e6 -->|method| 79be9e3e_427d_2797_27cf_ea0babfbadb8
  900fb1dc_21f2_793a_d0cc_dbf2e84679a7["isAlpnSupported()"]
  ed038636_6deb_9fdb_0fd6_26635e25e0e6 -->|method| 900fb1dc_21f2_793a_d0cc_dbf2e84679a7
  5e3a5475_1077_13c7_f0e3_4c7f030bc231["isOcspSupported()"]
  ed038636_6deb_9fdb_0fd6_26635e25e0e6 -->|method| 5e3a5475_1077_13c7_f0e3_4c7f030bc231
  a7fd545b_38bc_c0c6_b5c3_610e7eb8b618["isRenegotiationSupported()"]
  ed038636_6deb_9fdb_0fd6_26635e25e0e6 -->|method| a7fd545b_38bc_c0c6_b5c3_610e7eb8b618
  02787f75_56a0_3d33_4fc4_fed3dbd5571b["version()"]
  ed038636_6deb_9fdb_0fd6_26635e25e0e6 -->|method| 02787f75_56a0_3d33_4fc4_fed3dbd5571b
  4acccc68_44c4_724b_4f16_00f98dff5992["ensureAvailability()"]
  ed038636_6deb_9fdb_0fd6_26635e25e0e6 -->|method| 4acccc68_44c4_724b_4f16_00f98dff5992
  73cc6dc2_e4e1_f0f3_6976_79aad3f0a87d["Throwable()"]
  ed038636_6deb_9fdb_0fd6_26635e25e0e6 -->|method| 73cc6dc2_e4e1_f0f3_6976_79aad3f0a87d
  ce7119c4_2a60_b9c9_5c0c_ab749d53d569["availableCipherSuites()"]
  ed038636_6deb_9fdb_0fd6_26635e25e0e6 -->|method| ce7119c4_2a60_b9c9_5c0c_ab749d53d569

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/ssl/OpenSsl.java lines 65–899

public final class OpenSsl {

    private static final InternalLogger logger = InternalLoggerFactory.getInstance(OpenSsl.class);
    private static final Throwable UNAVAILABILITY_CAUSE;
    static final List<String> DEFAULT_CIPHERS;
    static final Set<String> AVAILABLE_CIPHER_SUITES;
    private static final Set<String> AVAILABLE_OPENSSL_CIPHER_SUITES;
    private static final Set<String> AVAILABLE_JAVA_CIPHER_SUITES;
    private static final boolean SUPPORTS_KEYMANAGER_FACTORY;
    private static final boolean USE_KEYMANAGER_FACTORY;
    private static final boolean SUPPORTS_OCSP;
    private static final boolean TLSV13_SUPPORTED;
    private static final boolean IS_BORINGSSL;
    private static final boolean IS_AWSLC;
    private static final Set<String> CLIENT_DEFAULT_PROTOCOLS;
    private static final Set<String> SERVER_DEFAULT_PROTOCOLS;

    private static final int SSL_V2_HELLO = 1;
    private static final int SSL_V2 = 1 << 1;
    private static final int SSL_V3 = 1 << 2;
    private static final int TLS_V1 = 1 << 3;
    private static final int TLS_V1_1 = 1 << 4;
    private static final int TLS_V1_2 = 1 << 5;
    private static final int TLS_V1_3 = 1 << 6;
    private static final int supportedProtocolsPacked;

    static final String[] EXTRA_SUPPORTED_TLS_1_3_CIPHERS;
    static final String EXTRA_SUPPORTED_TLS_1_3_CIPHERS_STRING;
    static final String[] NAMED_GROUPS;

    static final boolean JAVAX_CERTIFICATE_CREATION_SUPPORTED;

    // Use default that is supported in java 11 and earlier and also in OpenSSL / BoringSSL.
    // See https://github.com/netty/netty-tcnative/issues/567
    // See https://www.java.com/en/configure_crypto.html for ordering
    private static final String[] DEFAULT_NAMED_GROUPS = { "x25519", "secp256r1", "secp384r1", "secp521r1" };

    static {
        Throwable cause = null;

        if (SystemPropertyUtil.getBoolean("io.netty.handler.ssl.noOpenSsl", false)) {
            cause = new UnsupportedOperationException(
                    "OpenSSL was explicit disabled with -Dio.netty.handler.ssl.noOpenSsl=true");

            logger.debug(
                    "netty-tcnative explicit disabled; " +
                            OpenSslEngine.class.getSimpleName() + " will be unavailable.", cause);
        } else {
            // Test if netty-tcnative is in the classpath first.
            try {
                Class.forName("io.netty.internal.tcnative.SSLContext", false,
                        PlatformDependent.getClassLoader(OpenSsl.class));
            } catch (ClassNotFoundException t) {
                cause = t;
                logger.debug(
                        "netty-tcnative not in the classpath; " +
                                OpenSslEngine.class.getSimpleName() + " will be unavailable.");
            }

            // If in the classpath, try to load the native library and initialize netty-tcnative.
            if (cause == null) {
                try {
                    // The JNI library was not already loaded. Load it now.
                    loadTcNative();
                } catch (Throwable t) {
                    cause = t;
                    logger.debug(
                            "Failed to load netty-tcnative; " +
                                    OpenSslEngine.class.getSimpleName() + " will be unavailable, unless the " +
                                    "application has already loaded the symbols by some other means. " +
                                    "See https://netty.io/wiki/forked-tomcat-native.html for more information.", t);
                }

                try {
                    String engine = SystemPropertyUtil.get("io.netty.handler.ssl.openssl.engine", null);
                    if (engine == null) {
                        logger.debug("Initialize netty-tcnative using engine: 'default'");
                    } else {
                        logger.debug("Initialize netty-tcnative using engine: '{}'", engine);
                    }
                    initializeTcNative(engine);

Frequently Asked Questions

What is the OpenSsl class?
OpenSsl is a class in the netty codebase, defined in handler/src/main/java/io/netty/handler/ssl/OpenSsl.java.
Where is OpenSsl defined?
OpenSsl is defined in handler/src/main/java/io/netty/handler/ssl/OpenSsl.java at line 65.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free