manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1672737 - in /manifoldcf/trunk: ./ connectors/jira/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jira/ connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/ connectors/livelink/conne...
Date Fri, 10 Apr 2015 19:53:16 GMT
Author: kwright
Date: Fri Apr 10 19:53:15 2015
New Revision: 1672737

URL: http://svn.apache.org/r1672737
Log:
Fix for CONNECTORS-1186

Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jira/JiraSession.java
    manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraSession.java
    manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
    manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/meridio/MeridioWrapper.java
    manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/sharepoint/SharePointAuthority.java
    manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
    manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
    manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java
    manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java
    manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectionChangeTester.java

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1672737&r1=1672736&r2=1672737&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Fri Apr 10 19:53:15 2015
@@ -3,6 +3,10 @@ $Id$
 
 ======================= 2.1-dev =====================
 
+CONNECTORS-1186: HttpClient 4.4 requires that you set the SSL socket
+factory at the connection manager level.
+(Karl Wright)
+
 CONNECTORS-1185: Fix HttpClient deprecation warnings, and make sure
 socket timeouts are actually honored in http connections.
 (Karl Wright)

Modified: manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jira/JiraSession.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jira/JiraSession.java?rev=1672737&r1=1672736&r2=1672737&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jira/JiraSession.java
(original)
+++ manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jira/JiraSession.java
Fri Apr 10 19:53:15 2015
@@ -63,7 +63,10 @@ import org.apache.http.impl.client.Defau
 import org.apache.http.util.EntityUtils;
 import org.apache.http.client.HttpRequestRetryHandler;
 import org.apache.http.protocol.HttpContext;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
 import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.socket.PlainConnectionSocketFactory;
 import org.apache.http.conn.ssl.NoopHostnameVerifier;
 import org.apache.http.entity.ContentType;
 import org.apache.http.client.AuthCache;
@@ -127,7 +130,10 @@ public class JiraSession {
     SSLConnectionSocketFactory myFactory = new SSLConnectionSocketFactory(new InterruptibleSocketFactory(httpsSocketFactory,connectionTimeout),
       NoopHostnameVerifier.INSTANCE);
 
-    PoolingHttpClientConnectionManager poolingConnectionManager = new PoolingHttpClientConnectionManager();
+    PoolingHttpClientConnectionManager poolingConnectionManager = new PoolingHttpClientConnectionManager(RegistryBuilder.<ConnectionSocketFactory>create()
+        .register("http", PlainConnectionSocketFactory.getSocketFactory())
+        .register("https", myFactory)
+        .build());
     poolingConnectionManager.setDefaultMaxPerRoute(1);
     poolingConnectionManager.setValidateAfterInactivity(60000);
     poolingConnectionManager.setDefaultSocketConfig(SocketConfig.custom()
@@ -179,7 +185,6 @@ public class JiraSession {
       .disableAutomaticRetries()
       .setDefaultRequestConfig(requestBuilder.build())
       .setDefaultCredentialsProvider(credentialsProvider)
-      .setSSLSocketFactory(myFactory)
       .setRequestExecutor(new HttpRequestExecutor(socketTimeout))
       .setRedirectStrategy(new DefaultRedirectStrategy())
       .build();

Modified: manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraSession.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraSession.java?rev=1672737&r1=1672736&r2=1672737&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraSession.java
(original)
+++ manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraSession.java
Fri Apr 10 19:53:15 2015
@@ -61,7 +61,10 @@ import org.apache.http.impl.client.Defau
 import org.apache.http.util.EntityUtils;
 import org.apache.http.client.HttpRequestRetryHandler;
 import org.apache.http.protocol.HttpContext;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
 import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.socket.PlainConnectionSocketFactory;
 import org.apache.http.conn.ssl.NoopHostnameVerifier;
 import org.apache.http.entity.ContentType;
 import org.apache.http.client.AuthCache;
@@ -124,7 +127,10 @@ public class JiraSession {
     SSLConnectionSocketFactory myFactory = new SSLConnectionSocketFactory(new InterruptibleSocketFactory(httpsSocketFactory,connectionTimeout),
       NoopHostnameVerifier.INSTANCE);
 
-    PoolingHttpClientConnectionManager poolingConnectionManager = new PoolingHttpClientConnectionManager();
+    PoolingHttpClientConnectionManager poolingConnectionManager = new PoolingHttpClientConnectionManager(RegistryBuilder.<ConnectionSocketFactory>create()
+        .register("http", PlainConnectionSocketFactory.getSocketFactory())
+        .register("https", myFactory)
+        .build());
     poolingConnectionManager.setDefaultMaxPerRoute(1);
     poolingConnectionManager.setValidateAfterInactivity(60000);
     poolingConnectionManager.setDefaultSocketConfig(SocketConfig.custom()
@@ -177,7 +183,6 @@ public class JiraSession {
       .disableAutomaticRetries()
       .setDefaultRequestConfig(requestBuilder.build())
       .setDefaultCredentialsProvider(credentialsProvider)
-      .setSSLSocketFactory(myFactory)
       .setRequestExecutor(new HttpRequestExecutor(socketTimeout))
       .setRedirectStrategy(new DefaultRedirectStrategy())
       .build();

Modified: manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java?rev=1672737&r1=1672736&r2=1672737&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
(original)
+++ manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
Fri Apr 10 19:53:15 2015
@@ -52,7 +52,10 @@ import org.apache.http.client.HttpClient
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.methods.HttpPost;
 import org.apache.http.NameValuePair;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
 import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.socket.PlainConnectionSocketFactory;
 import org.apache.http.conn.ssl.NoopHostnameVerifier;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
@@ -524,8 +527,23 @@ public class LivelinkConnector extends o
       int socketTimeout = 900000;
       int connectionTimeout = 300000;
 
+      // Set up ingest ssl if indicated
+      SSLConnectionSocketFactory myFactory = null;
+      if (ingestKeystoreManager != null)
+      {
+        myFactory = new SSLConnectionSocketFactory(new InterruptibleSocketFactory(ingestKeystoreManager.getSecureSocketFactory(),
connectionTimeout),
+          NoopHostnameVerifier.INSTANCE);
+      }
+      else
+      {
+        myFactory = SSLConnectionSocketFactory.getSocketFactory();
+      }
+
       // Set up connection manager
-      PoolingHttpClientConnectionManager poolingConnectionManager = new PoolingHttpClientConnectionManager();
+      PoolingHttpClientConnectionManager poolingConnectionManager = new PoolingHttpClientConnectionManager(RegistryBuilder.<ConnectionSocketFactory>create()
+        .register("http", PlainConnectionSocketFactory.getSocketFactory())
+        .register("https", myFactory)
+        .build());
       poolingConnectionManager.setDefaultMaxPerRoute(1);
       poolingConnectionManager.setValidateAfterInactivity(60000);
       poolingConnectionManager.setDefaultSocketConfig(SocketConfig.custom()
@@ -536,14 +554,6 @@ public class LivelinkConnector extends o
       
       CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
 
-      // Set up ingest ssl if indicated
-      SSLConnectionSocketFactory myFactory = null;
-      if (ingestKeystoreManager != null)
-      {
-        myFactory = new SSLConnectionSocketFactory(new InterruptibleSocketFactory(ingestKeystoreManager.getSecureSocketFactory(),
connectionTimeout),
-          NoopHostnameVerifier.INSTANCE);
-      }
-
       // Set up authentication to use
       if (ingestNtlmDomain != null)
       {
@@ -565,9 +575,6 @@ public class LivelinkConnector extends o
         .setRequestExecutor(new HttpRequestExecutor(socketTimeout))
         .setRedirectStrategy(new DefaultRedirectStrategy());
 
-      if (myFactory != null)
-        builder.setSSLSocketFactory(myFactory);
-      
       httpClient = builder.build();
 
       // System.out.println("Connection server object = "+llServer.toString());

Modified: manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/meridio/MeridioWrapper.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/meridio/MeridioWrapper.java?rev=1672737&r1=1672736&r2=1672737&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/meridio/MeridioWrapper.java
(original)
+++ manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/meridio/MeridioWrapper.java
Fri Apr 10 19:53:15 2015
@@ -81,7 +81,10 @@ import org.apache.http.client.config.Req
 import org.apache.http.client.CredentialsProvider;
 import org.apache.http.impl.client.BasicCredentialsProvider;
 import org.apache.http.config.SocketConfig;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
 import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.socket.PlainConnectionSocketFactory;
 import org.apache.http.conn.ssl.NoopHostnameVerifier;
 import org.apache.http.impl.client.DefaultRedirectStrategy;
 import org.apache.http.auth.AuthScope;
@@ -220,6 +223,10 @@ public class MeridioWrapper
     {
       myFactory = new SSLConnectionSocketFactory(mySSLFactory, new NoopHostnameVerifier());
     }
+    else
+    {
+      myFactory = SSLConnectionSocketFactory.getSocketFactory();
+    }
 
     // Set up the pool.
     // We have a choice: We can either have one httpclient instance, which gets reinitialized
for every service
@@ -257,7 +264,10 @@ public class MeridioWrapper
     int socketTimeout = 900000;
     int connectionTimeout = 300000;
 
-    PoolingHttpClientConnectionManager poolingDmwsConnectionManager = new PoolingHttpClientConnectionManager();
+    PoolingHttpClientConnectionManager poolingDmwsConnectionManager = new PoolingHttpClientConnectionManager(RegistryBuilder.<ConnectionSocketFactory>create()
+        .register("http", PlainConnectionSocketFactory.getSocketFactory())
+        .register("https", myFactory)
+        .build());
     poolingDmwsConnectionManager.setDefaultMaxPerRoute(1);
     poolingDmwsConnectionManager.setValidateAfterInactivity(60000);
     poolingDmwsConnectionManager.setDefaultSocketConfig(SocketConfig.custom()
@@ -266,7 +276,10 @@ public class MeridioWrapper
       .build());
     dmwsConnectionManager = poolingDmwsConnectionManager;
     
-    PoolingHttpClientConnectionManager poolingRmwsConnectionManager = new PoolingHttpClientConnectionManager();
+    PoolingHttpClientConnectionManager poolingRmwsConnectionManager = new PoolingHttpClientConnectionManager(RegistryBuilder.<ConnectionSocketFactory>create()
+        .register("http", PlainConnectionSocketFactory.getSocketFactory())
+        .register("https", myFactory)
+        .build());
     poolingRmwsConnectionManager.setDefaultMaxPerRoute(1);
     poolingRmwsConnectionManager.setValidateAfterInactivity(60000);
     poolingRmwsConnectionManager.setDefaultSocketConfig(SocketConfig.custom()
@@ -275,7 +288,10 @@ public class MeridioWrapper
       .build());
     rmwsConnectionManager = poolingRmwsConnectionManager;
     
-    PoolingHttpClientConnectionManager poolingMcwsConnectionManager = new PoolingHttpClientConnectionManager();
+    PoolingHttpClientConnectionManager poolingMcwsConnectionManager = new PoolingHttpClientConnectionManager(RegistryBuilder.<ConnectionSocketFactory>create()
+        .register("http", PlainConnectionSocketFactory.getSocketFactory())
+        .register("https", myFactory)
+        .build());
     poolingMcwsConnectionManager.setDefaultMaxPerRoute(1);
     poolingMcwsConnectionManager.setValidateAfterInactivity(60000);
     poolingMcwsConnectionManager.setDefaultSocketConfig(SocketConfig.custom()
@@ -350,7 +366,6 @@ public class MeridioWrapper
       .disableAutomaticRetries()
       .setDefaultRequestConfig(dmwsRequestBuilder.build())
       .setDefaultCredentialsProvider(dmwsCredentialsProvider)
-      .setSSLSocketFactory(myFactory)
       .setRequestExecutor(new HttpRequestExecutor(socketTimeout))
       .setRedirectStrategy(new DefaultRedirectStrategy())
       .build();
@@ -360,7 +375,6 @@ public class MeridioWrapper
       .disableAutomaticRetries()
       .setDefaultRequestConfig(rmwsRequestBuilder.build())
       .setDefaultCredentialsProvider(rmwsCredentialsProvider)
-      .setSSLSocketFactory(myFactory)
       .setRequestExecutor(new HttpRequestExecutor(socketTimeout))
       .setRedirectStrategy(new DefaultRedirectStrategy())
       .build();
@@ -404,7 +418,6 @@ public class MeridioWrapper
         .disableAutomaticRetries()
         .setDefaultRequestConfig(mcwsRequestBuilder.build())
         .setDefaultCredentialsProvider(mcwsCredentialsProvider)
-        .setSSLSocketFactory(myFactory)
         .setRequestExecutor(new HttpRequestExecutor(socketTimeout))
         .setRedirectStrategy(new DefaultRedirectStrategy())
         .build();

Modified: manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/sharepoint/SharePointAuthority.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/sharepoint/SharePointAuthority.java?rev=1672737&r1=1672736&r2=1672737&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/sharepoint/SharePointAuthority.java
(original)
+++ manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/sharepoint/SharePointAuthority.java
Fri Apr 10 19:53:15 2015
@@ -45,7 +45,10 @@ import org.apache.http.client.config.Req
 import org.apache.http.client.CredentialsProvider;
 import org.apache.http.impl.client.BasicCredentialsProvider;
 import org.apache.http.config.SocketConfig;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
 import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.socket.PlainConnectionSocketFactory;
 import org.apache.http.conn.ssl.DefaultHostnameVerifier;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
@@ -792,7 +795,21 @@ public class SharePointAuthority extends
       
       // Set up ssl if indicated
 
-      PoolingHttpClientConnectionManager poolingConnectionManager = new PoolingHttpClientConnectionManager();
+      SSLConnectionSocketFactory myFactory = null;
+      if (keystoreData != null)
+      {
+        keystoreManager = KeystoreManagerFactory.make("",keystoreData);
+        myFactory = new SSLConnectionSocketFactory(keystoreManager.getSecureSocketFactory(),
new DefaultHostnameVerifier());
+      }
+      else
+      {
+        myFactory = SSLConnectionSocketFactory.getSocketFactory();
+      }
+
+      PoolingHttpClientConnectionManager poolingConnectionManager = new PoolingHttpClientConnectionManager(RegistryBuilder.<ConnectionSocketFactory>create()
+        .register("http", PlainConnectionSocketFactory.getSocketFactory())
+        .register("https", myFactory)
+        .build());
       poolingConnectionManager.setDefaultMaxPerRoute(1);
       poolingConnectionManager.setValidateAfterInactivity(60000);
       poolingConnectionManager.setDefaultSocketConfig(SocketConfig.custom()
@@ -803,13 +820,6 @@ public class SharePointAuthority extends
 
       CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
 
-      SSLConnectionSocketFactory myFactory = null;
-      if (keystoreData != null)
-      {
-        keystoreManager = KeystoreManagerFactory.make("",keystoreData);
-        myFactory = new SSLConnectionSocketFactory(keystoreManager.getSecureSocketFactory(),
new DefaultHostnameVerifier());
-      }
-
       if (strippedUserName != null)
       {
         credentialsProvider.setCredentials(
@@ -851,8 +861,6 @@ public class SharePointAuthority extends
         .disableAutomaticRetries()
         .setDefaultRequestConfig(requestBuilder.build())
         .setDefaultCredentialsProvider(credentialsProvider);
-      if (myFactory != null)
-        builder.setSSLSocketFactory(myFactory);
       builder.setRequestExecutor(new HttpRequestExecutor(socketTimeout))
         .setRedirectStrategy(new DefaultRedirectStrategy());
       httpClient = builder.build();

Modified: manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java?rev=1672737&r1=1672736&r2=1672737&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
(original)
+++ manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
Fri Apr 10 19:53:15 2015
@@ -55,7 +55,10 @@ import org.apache.http.client.config.Req
 import org.apache.http.client.CredentialsProvider;
 import org.apache.http.impl.client.BasicCredentialsProvider;
 import org.apache.http.config.SocketConfig;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
 import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.socket.PlainConnectionSocketFactory;
 import org.apache.http.conn.ssl.DefaultHostnameVerifier;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
@@ -255,7 +258,21 @@ public class SharePointRepository extend
       int connectionTimeout = 60000;
       int socketTimeout = 900000;
 
-      PoolingHttpClientConnectionManager poolingConnectionManager = new PoolingHttpClientConnectionManager();
+      SSLConnectionSocketFactory myFactory = null;
+      if (keystoreData != null)
+      {
+        keystoreManager = KeystoreManagerFactory.make("",keystoreData);
+        myFactory = new SSLConnectionSocketFactory(keystoreManager.getSecureSocketFactory(),
new DefaultHostnameVerifier());
+      }
+      else
+      {
+        myFactory = SSLConnectionSocketFactory.getSocketFactory();
+      }
+
+      PoolingHttpClientConnectionManager poolingConnectionManager = new PoolingHttpClientConnectionManager(RegistryBuilder.<ConnectionSocketFactory>create()
+        .register("http", PlainConnectionSocketFactory.getSocketFactory())
+        .register("https", myFactory)
+        .build());
       poolingConnectionManager.setDefaultMaxPerRoute(1);
       poolingConnectionManager.setValidateAfterInactivity(60000);
       poolingConnectionManager.setDefaultSocketConfig(SocketConfig.custom()
@@ -266,13 +283,6 @@ public class SharePointRepository extend
       
       CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
 
-      SSLConnectionSocketFactory myFactory = null;
-      if (keystoreData != null)
-      {
-        keystoreManager = KeystoreManagerFactory.make("",keystoreData);
-        myFactory = new SSLConnectionSocketFactory(keystoreManager.getSecureSocketFactory(),
new DefaultHostnameVerifier());
-      }
-
       if (strippedUserName != null)
       {
         credentialsProvider.setCredentials(
@@ -314,8 +324,6 @@ public class SharePointRepository extend
         .disableAutomaticRetries()
         .setDefaultRequestConfig(requestBuilder.build())
         .setDefaultCredentialsProvider(credentialsProvider);
-      if (myFactory != null)
-        builder.setSSLSocketFactory(myFactory);
       builder.setRequestExecutor(new HttpRequestExecutor(socketTimeout))
         .setRedirectStrategy(new DefaultRedirectStrategy());
       httpClient = builder.build();

Modified: manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java?rev=1672737&r1=1672736&r2=1672737&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
(original)
+++ manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
Fri Apr 10 19:53:15 2015
@@ -22,7 +22,10 @@ import org.apache.http.client.Credential
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.config.RequestConfig;
 import org.apache.http.config.SocketConfig;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
 import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.socket.PlainConnectionSocketFactory;
 import org.apache.http.conn.ssl.NoopHostnameVerifier;
 import org.apache.http.impl.client.*;
 import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
@@ -211,14 +214,6 @@ public class HttpPoster
     }
 
     // Initialize standard solr-j.
-    // First, we need an HttpClient where basic auth is properly set up.
-    connectionManager = new PoolingHttpClientConnectionManager();
-    connectionManager.setDefaultMaxPerRoute(1);
-    connectionManager.setValidateAfterInactivity(60000);
-    connectionManager.setDefaultSocketConfig(SocketConfig.custom()
-      .setTcpNoDelay(true)
-      .setSoTimeout(socketTimeout)
-      .build());
     
     SSLConnectionSocketFactory myFactory;
     if (keystoreManager != null)
@@ -231,6 +226,18 @@ public class HttpPoster
       myFactory = new SSLConnectionSocketFactory(KeystoreManagerFactory.getTrustingSecureSocketFactory(),NoopHostnameVerifier.INSTANCE);
     }
 
+    // First, we need an HttpClient where basic auth is properly set up.
+    connectionManager = new PoolingHttpClientConnectionManager(RegistryBuilder.<ConnectionSocketFactory>create()
+      .register("http", PlainConnectionSocketFactory.getSocketFactory())
+      .register("https", myFactory)
+      .build());
+    connectionManager.setDefaultMaxPerRoute(1);
+    connectionManager.setValidateAfterInactivity(60000);
+    connectionManager.setDefaultSocketConfig(SocketConfig.custom()
+      .setTcpNoDelay(true)
+      .setSoTimeout(socketTimeout)
+      .build());
+    
     RequestConfig.Builder requestBuilder = RequestConfig.custom()
       .setCircularRedirectsAllowed(true)
       .setSocketTimeout(socketTimeout)
@@ -240,11 +247,9 @@ public class HttpPoster
 
     HttpClientBuilder clientBuilder = HttpClients.custom()
       .setConnectionManager(connectionManager)
-      .setMaxConnTotal(1)
       .disableAutomaticRetries()
       .setDefaultRequestConfig(requestBuilder.build())
       .setRedirectStrategy(new DefaultRedirectStrategy())
-      .setSSLSocketFactory(myFactory)
       .setRequestExecutor(new HttpRequestExecutor(socketTimeout));
 
 

Modified: manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java?rev=1672737&r1=1672736&r2=1672737&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java
(original)
+++ manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java
Fri Apr 10 19:53:15 2015
@@ -48,7 +48,10 @@ import org.apache.http.config.SocketConf
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.methods.HttpPost;
 import org.apache.http.NameValuePair;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
 import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.socket.PlainConnectionSocketFactory;
 import org.apache.http.conn.ssl.NoopHostnameVerifier;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
@@ -468,7 +471,10 @@ public class ThrottledFetcher
       
       if (connManager == null)
       {
-        PoolingHttpClientConnectionManager poolingConnManager = new PoolingHttpClientConnectionManager();
+        PoolingHttpClientConnectionManager poolingConnManager = new PoolingHttpClientConnectionManager(RegistryBuilder.<ConnectionSocketFactory>create()
+          .register("http", PlainConnectionSocketFactory.getSocketFactory())
+          .register("https", myFactory)
+          .build());
         poolingConnManager.setDefaultMaxPerRoute(1);
         poolingConnManager.setValidateAfterInactivity(60000);
         poolingConnManager.setDefaultSocketConfig(SocketConfig.custom()
@@ -527,10 +533,8 @@ public class ThrottledFetcher
         .disableAutomaticRetries()
         .setDefaultRequestConfig(requestBuilder.build())
         .setDefaultCredentialsProvider(credentialsProvider)
-        .setSSLSocketFactory(myFactory)
         .setRequestExecutor(new HttpRequestExecutor(socketTimeoutMilliseconds))
         .setRedirectStrategy(new DefaultRedirectStrategy())
-        // ??? need to add equivalent of setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY)
         .build();
 
         /*

Modified: manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java?rev=1672737&r1=1672736&r2=1672737&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java
(original)
+++ manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java
Fri Apr 10 19:53:15 2015
@@ -64,7 +64,10 @@ import org.apache.http.util.EntityUtils;
 import org.apache.http.message.BasicHeader;
 import org.apache.http.client.HttpRequestRetryHandler;
 import org.apache.http.protocol.HttpContext;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
 import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.socket.PlainConnectionSocketFactory;
 import org.apache.http.conn.ssl.NoopHostnameVerifier;
 import org.apache.http.entity.ContentType;
 
@@ -231,7 +234,10 @@ public class WikiConnector extends org.a
         NoopHostnameVerifier.INSTANCE);
 
       // Set up connection manager
-      PoolingHttpClientConnectionManager poolingConnectionManager = new PoolingHttpClientConnectionManager();
+      PoolingHttpClientConnectionManager poolingConnectionManager = new PoolingHttpClientConnectionManager(RegistryBuilder.<ConnectionSocketFactory>create()
+        .register("http", PlainConnectionSocketFactory.getSocketFactory())
+        .register("https", myFactory)
+        .build());
       poolingConnectionManager.setDefaultMaxPerRoute(1);
       poolingConnectionManager.setValidateAfterInactivity(60000);
       poolingConnectionManager.setDefaultSocketConfig(SocketConfig.custom()

Modified: manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectionChangeTester.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectionChangeTester.java?rev=1672737&r1=1672736&r2=1672737&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectionChangeTester.java
(original)
+++ manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectionChangeTester.java
Fri Apr 10 19:53:15 2015
@@ -97,7 +97,7 @@ public class ConnectionChangeTester
     
     // Now, delete the job.
     jobManager.deleteJob(job.getID());
-    instance.waitJobDeletedNative(jobManager,job.getID(),30000L);
+    instance.waitJobDeletedNative(jobManager,job.getID(),60000L);
 
     // Shut down instance2
     instance.stop();



Mime
View raw message