knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmin...@apache.org
Subject [2/3] knox git commit: Revert "[KNOX-680] - Update Knox's HttpClient dependency to latest version"
Date Sat, 05 Mar 2016 21:59:53 GMT
Revert "[KNOX-680] - Update Knox's HttpClient dependency to latest version"

This reverts commit 5f0bfdf8791c28b8ed804bc81ad48c2e1223ea15.


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

Branch: refs/heads/master
Commit: 5f27642e98d9fbe101ddab13153319d4b94717aa
Parents: 8bee259
Author: Kevin Minder <kminder@apache.org>
Authored: Sat Mar 5 16:11:35 2016 -0500
Committer: Kevin Minder <kminder@apache.org>
Committed: Sat Mar 5 16:11:35 2016 -0500

----------------------------------------------------------------------
 CHANGES                                         |  1 -
 .../hadoop/gateway/GatewayMultiFuncTest.java    |  1 +
 .../hadoop/gateway/GatewaySslFuncTest.java      | 31 ++++++++++++++++++--
 pom.xml                                         |  2 +-
 4 files changed, 30 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/5f27642e/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 06efd2d..2877e83 100644
--- a/CHANGES
+++ b/CHANGES
@@ -8,7 +8,6 @@ Release Notes - Apache Knox - Version 0.9.0
     * [KNOX-677] - Upgrade to latest Groovy
     * [KNOX-675] - Upgrade Knox's Jetty dependency to latest 9.x
     * [KNOX-678] - Malformed UTF-8 characters in JSON Response
-    * [KNOX-680] - Update Knox's HttpClient dependency to latest version
 ** Bug
 
 ------------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/knox/blob/5f27642e/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayMultiFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayMultiFuncTest.java
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayMultiFuncTest.java
index 8c29ce5..47fe9bd 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayMultiFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayMultiFuncTest.java
@@ -81,6 +81,7 @@ public class GatewayMultiFuncTest {
   @BeforeClass
   public static void setupSuite() throws Exception {
     LOG_ENTER();
+    RestAssured.config = newConfig().connectionConfig(connectionConfig().closeIdleConnectionsAfterEachResponse());
     //appenders = NoOpAppender.setUp();
     setupLdap();
     setupGateway();

http://git-wip-us.apache.org/repos/asf/knox/blob/5f27642e/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySslFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySslFuncTest.java
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySslFuncTest.java
index 7032236..b419231 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySslFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySslFuncTest.java
@@ -18,6 +18,7 @@
 package org.apache.hadoop.gateway;
 
 import java.io.File;
+import java.io.IOException;
 import java.net.URL;
 import java.security.KeyManagementException;
 import java.security.NoSuchAlgorithmException;
@@ -32,10 +33,11 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.ServiceLoader;
 import java.util.UUID;
-import javax.net.ssl.HostnameVerifier;
 import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLException;
 import javax.net.ssl.SSLHandshakeException;
 import javax.net.ssl.SSLSession;
+import javax.net.ssl.SSLSocket;
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.X509TrustManager;
 import javax.xml.transform.stream.StreamSource;
@@ -60,6 +62,7 @@ import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.ssl.X509HostnameVerifier;
 import org.apache.http.impl.auth.BasicScheme;
 import org.apache.http.impl.client.BasicAuthCache;
 import org.apache.http.impl.client.BasicCredentialsProvider;
@@ -233,11 +236,14 @@ public class GatewaySslFuncTest {
     context.setAuthCache( authCache );
 
     CloseableHttpClient client = HttpClients.custom()
+        .setHostnameVerifier( new TrustAllHosts() )
+        .setSslcontext( createInsecureSslContext() )
         .setSSLSocketFactory(
             new SSLConnectionSocketFactory(
                 createInsecureSslContext(),
                 new String[]{"TLSv1.2"},
                 new String[]{"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"},
+
                 new TrustAllHosts() ) )
         .build();
     HttpGet request = new HttpGet( serviceUrl );
@@ -255,6 +261,8 @@ public class GatewaySslFuncTest {
 
     try {
       client = HttpClients.custom()
+          .setHostnameVerifier( new TrustAllHosts() )
+          .setSslcontext( createInsecureSslContext() )
           .setSSLSocketFactory(
               new SSLConnectionSocketFactory(
                   createInsecureSslContext(),
@@ -270,6 +278,8 @@ public class GatewaySslFuncTest {
     }
 
     client = HttpClients.custom()
+        .setHostnameVerifier( new TrustAllHosts() )
+        .setSslcontext( createInsecureSslContext() )
         .setSSLSocketFactory(
             new SSLConnectionSocketFactory(
                 createInsecureSslContext(),
@@ -285,11 +295,26 @@ public class GatewaySslFuncTest {
     LOG_EXIT();
   }
 
-  public static class TrustAllHosts implements HostnameVerifier {
+  public static class TrustAllHosts implements X509HostnameVerifier {
+    @Override
+    public void verify( String host, SSLSocket ssl ) throws IOException {
+      // Trust all hostnames.
+    }
+
+    @Override
+    public void verify( String host, X509Certificate cert ) throws SSLException {
+      // Trust all hostnames.
+    }
+
+    @Override
+    public void verify( String host, String[] cns, String[] subjectAlts ) throws SSLException
{
+      // Trust all hostnames.
+    }
+
     @Override
     public boolean verify( String host, SSLSession sslSession ) {
       // Trust all hostnames.
-      return true;
+      return false;
     }
   }
 

http://git-wip-us.apache.org/repos/asf/knox/blob/5f27642e/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b1eb6c1..f185dac 100644
--- a/pom.xml
+++ b/pom.xml
@@ -739,7 +739,7 @@
             <dependency>
                 <groupId>org.apache.httpcomponents</groupId>
                 <artifactId>httpclient</artifactId>
-                <version>4.5.2</version>
+                <version>4.3.6</version>
             </dependency>
             <dependency>
                 <groupId>joda-time</groupId>


Mime
View raw message