static void configureSslContext(SslContextBuilder sslContextBuilder,
                                    @Nullable KeyStore keyStore, @Nullable String keyStorePassword,
                                    @Nullable KeyStore trustStore, boolean isTrustSelfSignedCertificates) {
        try {
            if (trustStore != null) {
                final TrustManagerFactory trustManagerFactory =
                        TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
                trustManagerFactory.init(trustStore);
                if (isTrustSelfSignedCertificates) {
                    sslContextBuilder.trustManager(trustSelfSignedFactory(trustManagerFactory));
                } else {
                    sslContextBuilder.trustManager(trustManagerFactory);
                }
            }
            if (keyStore != null) {
                final KeyManagerFactory keyManagerFactory =
                        KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
                keyManagerFactory.init(keyStore,
                                       keyStorePassword == null ? null : keyStorePassword.toCharArray());
                sslContextBuilder.keyManager(keyManagerFactory);
            }
        } catch (NoSuchAlgorithmException | KeyStoreException | UnrecoverableKeyException e) {
            throw new IllegalStateException("Failed to configure TLS: " + e, e);
        }
    }
Adds SSL/TLS context to the specified {@link SslContextBuilder}.
resteasy/src/main/java/com/linecorp/armeria/client/resteasy/SslContextConfigurator.java