private SslContext initSSLContext() {
        InputStream in = null;
        try {
            String sslKeyStoreType = configuration.option(BoltClientOption.CLI_SSL_KEYSTORE_TYPE);
            if (sslKeyStoreType == null) {
                // fixme: remove in next version
                sslKeyStoreType = RpcConfigManager.client_ssl_keystore_type();
            }
            KeyStore ks = KeyStore.getInstance(sslKeyStoreType);
            String sslKeyStore = configuration.option(BoltClientOption.CLI_SSL_KEYSTORE);
            if (sslKeyStore == null) {
                sslKeyStore = RpcConfigManager.client_ssl_keystore();
            }
            in = new FileInputStream(sslKeyStore);
            String keyStorePass = configuration.option(BoltClientOption.CLI_SSL_KEYSTORE_PASS);
            if (keyStorePass == null) {
                keyStorePass = RpcConfigManager.client_ssl_keystore_pass();
            }
            char[] passChs = keyStorePass.toCharArray();
            ks.load(in, passChs);
            String serverSslAlgorithm = configuration.option(BoltServerOption.SRV_SSL_KMF_ALGO);
            if (serverSslAlgorithm == null) {
                serverSslAlgorithm = RpcConfigManager.server_ssl_kmf_algorithm();
            }
            KeyManagerFactory kmf = KeyManagerFactory.getInstance(serverSslAlgorithm);
            kmf.init(ks, passChs);
            String sslAlgorithm = configuration.option(BoltClientOption.CLI_SSL_TMF_ALGO);
            if (sslAlgorithm == null) {
                sslAlgorithm = RpcConfigManager.client_ssl_tmf_algorithm();
            }
            TrustManagerFactory tmf = TrustManagerFactory.getInstance(sslAlgorithm);
            tmf.init(ks);

            return SslContextBuilder.forClient().keyManager(kmf).trustManager(tmf).build();
        } catch (Exception e) {
            logger.error("Fail to init SSL context for connection factory.", e);
            throw new IllegalStateException("Fail to init SSL context", e);
        } finally {
            IoUtils.closeQuietly(in);
        }

    }
init netty write buffer water mark
src/main/java/com/alipay/remoting/connection/AbstractConnectionFactory.java