Code example for Scheme

        // Create a registry for our three schemes; http and https will use built-in factories 
        SchemeRegistry registry = new SchemeRegistry();
        registry.register(new Scheme("http",
                PlainSocketFactory.getSocketFactory(), 80));
        registry.register(new Scheme("https",
                SSLUtils.getHttpSocketFactory(false, keyManager), 443));
        // Register the httpts scheme with our insecure factory 
        registry.register(new Scheme("httpts",
                SSLUtils.getHttpSocketFactory(true /*insecure*/, keyManager), 443));
        return new EmailClientConnectionManager(params, registry, keyManager);
     * Ensures that a client SSL certificate is known to be used for the specified connection 
     * manager. 
     * A {@link SchemeRegistry} is used to denote which client certificates to use for a given 
     * connection, so clients of this connection manager should use 
     * {@link #makeSchemeForClientCert(String, boolean)}. 
Experience pair programming with AI  Get Codota for Java