Repository: jclouds
Updated Branches:
  refs/heads/master b3882cbfe -> ad6675281


Minor code cleanup in Apache HC config module

* Renaming provider
* Removing duplicate code


Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/ad667528
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/ad667528
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/ad667528

Branch: refs/heads/master
Commit: ad6675281195afabfeb2e520d980c12280aa11ac
Parents: b3882cb
Author: Andrew Phillips <[email protected]>
Authored: Sat Oct 18 07:57:48 2014 -0400
Committer: Andrew Phillips <[email protected]>
Committed: Tue Oct 21 09:40:46 2014 -0400

----------------------------------------------------------------------
 .../ApacheHCHttpCommandExecutorServiceModule.java     | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds/blob/ad667528/drivers/apachehc/src/main/java/org/jclouds/http/apachehc/config/ApacheHCHttpCommandExecutorServiceModule.java
----------------------------------------------------------------------
diff --git 
a/drivers/apachehc/src/main/java/org/jclouds/http/apachehc/config/ApacheHCHttpCommandExecutorServiceModule.java
 
b/drivers/apachehc/src/main/java/org/jclouds/http/apachehc/config/ApacheHCHttpCommandExecutorServiceModule.java
index facc913..c568508 100644
--- 
a/drivers/apachehc/src/main/java/org/jclouds/http/apachehc/config/ApacheHCHttpCommandExecutorServiceModule.java
+++ 
b/drivers/apachehc/src/main/java/org/jclouds/http/apachehc/config/ApacheHCHttpCommandExecutorServiceModule.java
@@ -109,7 +109,7 @@ public class ApacheHCHttpCommandExecutorServiceModule 
extends AbstractModule {
 
    @Singleton
    @Provides
-   SSLContext newSSLSocketFactory(HttpUtils utils, @Named("untrusted") 
Supplier<SSLContext> untrustedSSLContextProvider)
+   SSLContext newSSLContext(HttpUtils utils, @Named("untrusted") 
Supplier<SSLContext> untrustedSSLContextProvider)
             throws NoSuchAlgorithmException, KeyManagementException {
       if (utils.trustAllCerts())
          return untrustedSSLContextProvider.get();
@@ -125,20 +125,12 @@ public class ApacheHCHttpCommandExecutorServiceModule 
extends AbstractModule {
             SSLContext context, Closer closer) throws 
NoSuchAlgorithmException, KeyManagementException {
 
       SchemeRegistry schemeRegistry = new SchemeRegistry();
+      schemeRegistry.register(new Scheme("http", 
PlainSocketFactory.getSocketFactory(), 80));
 
-      Scheme http = new Scheme("http", PlainSocketFactory.getSocketFactory(), 
80);
       SSLSocketFactory sf = new SSLSocketFactory(context);
-
       sf.setHostnameVerifier(verifier);
-
-      Scheme https = new Scheme("https", sf, 443);
-
-      SchemeRegistry sr = new SchemeRegistry();
-      sr.register(http);
-      sr.register(https);
-
-      schemeRegistry.register(new Scheme("http", 
PlainSocketFactory.getSocketFactory(), 80));
       schemeRegistry.register(new Scheme("https", sf, 443));
+
       final ClientConnectionManager cm = new 
ThreadSafeClientConnManager(params, schemeRegistry);
       closer.addToClose(new Closeable() {
          @Override

Reply via email to