private SslEngineFactory instantiateSslEngineFactory(Map<String, Object> configs) {
        @SuppressWarnings("unchecked")
        Class<? extends SslEngineFactory> sslEngineFactoryClass =
                (Class<? extends SslEngineFactory>) configs.get(SslConfigs.SSL_ENGINE_FACTORY_CLASS_CONFIG);
        SslEngineFactory sslEngineFactory;
        if (sslEngineFactoryClass == null) {
            sslEngineFactory = new DefaultSslEngineFactory();
        } else {
            sslEngineFactory = Utils.newInstance(sslEngineFactoryClass);
        }
        sslEngineFactory.configure(configs);
        this.sslEngineFactoryConfig = configs;
        return sslEngineFactory;
    }
Create an SslFactory.

@param connectionMode                        Whether to use client or server mode.
@param clientAuthConfigOverride              The value to override ssl.client.auth with, or null
                                             if we don't want to override it.
@param keystoreVerifiableUsingTruststore     True if we should require the keystore to be verifiable
                                             using the truststore.
clients/src/main/java/org/apache/kafka/common/security/ssl/SslFactory.java