socketFactory = new SSLSocketFactory(sslContextParams.createSSLContext());
}
socketFactory.setHostnameVerifier(x509HostnameVerifier);
// must register both https and https4
registry.register(new Scheme("https", port, socketFactory));
LOG.info("Registering SSL scheme https on port " + port);
registry.register(new Scheme("https4", port, socketFactory));
LOG.info("Registering SSL scheme https4 on port " + port);
} else {
// must register both http and http4
registry.register(new Scheme("http", port, new PlainSocketFactory()));
LOG.info("Registering PLAIN scheme http on port " + port);
registry.register(new Scheme("http4", port, new PlainSocketFactory()));
LOG.info("Registering PLAIN scheme http4 on port " + port);
}
}