cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [cxf] 01/08: Refactor of deprecated hostname verification tests
Date Wed, 06 Jun 2018 19:30:50 GMT
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 16d2c36519672ae253be9e38ed6be817138e2a51
Author: Colm O hEigeartaigh <coheigea@apache.org>
AuthorDate: Wed Jun 6 11:01:38 2018 +0100

    Refactor of deprecated hostname verification tests
    
    (cherry picked from commit b2b6199885a87f244feda4dc1ba084a097b4be3f)
---
 .../HostnameVerificationDeprecatedServer.java      |  2 +-
 .../HostnameVerificationDeprecatedTest.java        | 10 +++----
 .../https/hostname/hostname-client-bethal.xml      | 34 ----------------------
 ...r-bethal.xml => hostname-server-deprecated.xml} |  5 ++--
 .../cxf/systest/https/hostname/hostname-server.xml |  2 +-
 5 files changed, 10 insertions(+), 43 deletions(-)

diff --git a/systests/transports/src/test/java/org/apache/cxf/systest/https/hostname/HostnameVerificationDeprecatedServer.java
b/systests/transports/src/test/java/org/apache/cxf/systest/https/hostname/HostnameVerificationDeprecatedServer.java
index 28c8d41..3c624bf 100644
--- a/systests/transports/src/test/java/org/apache/cxf/systest/https/hostname/HostnameVerificationDeprecatedServer.java
+++ b/systests/transports/src/test/java/org/apache/cxf/systest/https/hostname/HostnameVerificationDeprecatedServer.java
@@ -33,7 +33,7 @@ public class HostnameVerificationDeprecatedServer extends AbstractBusTestServerB
     }
 
     protected void run()  {
-        URL busFile = HostnameVerificationDeprecatedServer.class.getResource("hostname-server-bethal.xml");
+        URL busFile = HostnameVerificationDeprecatedServer.class.getResource("hostname-server-deprecated.xml");
         Bus busLocal = new SpringBusFactory().createBus(busFile);
         BusFactory.setDefaultBus(busLocal);
         setBus(busLocal);
diff --git a/systests/transports/src/test/java/org/apache/cxf/systest/https/hostname/HostnameVerificationDeprecatedTest.java
b/systests/transports/src/test/java/org/apache/cxf/systest/https/hostname/HostnameVerificationDeprecatedTest.java
index b464c2b..a9ea8a1 100644
--- a/systests/transports/src/test/java/org/apache/cxf/systest/https/hostname/HostnameVerificationDeprecatedTest.java
+++ b/systests/transports/src/test/java/org/apache/cxf/systest/https/hostname/HostnameVerificationDeprecatedTest.java
@@ -34,8 +34,8 @@ import org.junit.AfterClass;
 import org.junit.BeforeClass;
 
 /**
- * A test for hostname verification when the Java system property "java.protocol.handler.pkgs"
is set to 
- * "com.sun.net.ssl.internal.www.protocol". This means that com.sun.net.ssl.HostnameVerifier
is used 
+ * A test for hostname verification when the Java system property "java.protocol.handler.pkgs"
is set to
+ * "com.sun.net.ssl.internal.www.protocol". This means that com.sun.net.ssl.HostnameVerifier
is used
  * instead of the javax version.
  */
 public class HostnameVerificationDeprecatedTest extends AbstractBusClientServerTestBase {
@@ -64,7 +64,7 @@ public class HostnameVerificationDeprecatedTest extends AbstractBusClientServerT
     @org.junit.Test
     public void testLocalhostNotMatching() throws Exception {
         SpringBusFactory bf = new SpringBusFactory();
-        URL busFile = HostnameVerificationDeprecatedTest.class.getResource("hostname-client-bethal.xml");
+        URL busFile = HostnameVerificationDeprecatedTest.class.getResource("hostname-client.xml");
 
         Bus bus = bf.createBus(busFile.toString());
         BusFactory.setDefaultBus(bus);
@@ -77,7 +77,7 @@ public class HostnameVerificationDeprecatedTest extends AbstractBusClientServerT
         assertNotNull("Port is null", port);
 
         updateAddressPort(port, PORT);
-        
+
         try {
             port.greetMe("Kitty");
             fail("Failure expected on the hostname verification");
@@ -88,7 +88,7 @@ public class HostnameVerificationDeprecatedTest extends AbstractBusClientServerT
         ((java.io.Closeable)port).close();
         bus.shutdown(true);
     }
-    
+
     // No Subject Alternative Name, but the CN matches ("localhost"), so the default HostnameVerifier
     // should work fine
     @org.junit.Test
diff --git a/systests/transports/src/test/resources/org/apache/cxf/systest/https/hostname/hostname-client-bethal.xml
b/systests/transports/src/test/resources/org/apache/cxf/systest/https/hostname/hostname-client-bethal.xml
deleted file mode 100644
index 87f3596..0000000
--- a/systests/transports/src/test/resources/org/apache/cxf/systest/https/hostname/hostname-client-bethal.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
- 
- http://www.apache.org/licenses/LICENSE-2.0
- 
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:http="http://cxf.apache.org/transports/http/configuration" xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:cxf="http://cxf.apache.org/core" xmlns:p="http://cxf.apache.org/policy" xmlns:sec="http://cxf.apache.org/configuration/security"
xsi:schemaLocation="           http://www.springframework.org/schema/beans           http://www.springframework.org/schema/beans/spring-b
[...]
-    
-    <cxf:bus>
-        <cxf:features>
-            <cxf:logging/>
-        </cxf:features>
-    </cxf:bus>
-    <http:conduit name="https://localhost:.*">
-        <http:tlsClientParameters>
-            <sec:trustManagers>
-                <sec:keyStore type="jks" password="password" resource="keys/Bethal.jks"/>
-            </sec:trustManagers>
-        </http:tlsClientParameters>
-    </http:conduit>
-</beans>
diff --git a/systests/transports/src/test/resources/org/apache/cxf/systest/https/hostname/hostname-server-bethal.xml
b/systests/transports/src/test/resources/org/apache/cxf/systest/https/hostname/hostname-server-deprecated.xml
similarity index 95%
rename from systests/transports/src/test/resources/org/apache/cxf/systest/https/hostname/hostname-server-bethal.xml
rename to systests/transports/src/test/resources/org/apache/cxf/systest/https/hostname/hostname-server-deprecated.xml
index 9babe68..fc3a627 100644
--- a/systests/transports/src/test/resources/org/apache/cxf/systest/https/hostname/hostname-server-bethal.xml
+++ b/systests/transports/src/test/resources/org/apache/cxf/systest/https/hostname/hostname-server-deprecated.xml
@@ -28,10 +28,11 @@
     <httpj:engine-factory id="non-localhost-match-settings">
         <httpj:engine port="${testutil.ports.HostnameVerificationDeprecatedServer}">
             <httpj:tlsServerParameters>
-                <sec:keyManagers keyPassword="password">
-                    <sec:keyStore type="jks" password="password" resource="keys/Bethal.jks"/>
+                <sec:keyManagers keyPassword="security">
+                    <sec:keyStore type="jks" password="security" resource="keys/subjalt.jks"/>
                 </sec:keyManagers>
                 <sec:clientAuthentication want="false" required="false"/>
+                <sec:certAlias>nosubjaltcnnomatch</sec:certAlias>
             </httpj:tlsServerParameters>
         </httpj:engine>
     </httpj:engine-factory>
diff --git a/systests/transports/src/test/resources/org/apache/cxf/systest/https/hostname/hostname-server.xml
b/systests/transports/src/test/resources/org/apache/cxf/systest/https/hostname/hostname-server.xml
index 21101e0..b3137f0 100644
--- a/systests/transports/src/test/resources/org/apache/cxf/systest/https/hostname/hostname-server.xml
+++ b/systests/transports/src/test/resources/org/apache/cxf/systest/https/hostname/hostname-server.xml
@@ -94,7 +94,7 @@
                     <sec:keyStore type="jks" password="security" resource="keys/subjalt.jks"/>
                 </sec:keyManagers>
                 <sec:clientAuthentication want="false" required="false"/>
-                <sec:certAlias>nosubjaltnocnmatch</sec:certAlias>
+                <sec:certAlias>nosubjaltcnnomatch</sec:certAlias>
             </httpj:tlsServerParameters>
         </httpj:engine>
     </httpj:engine-factory>

-- 
To stop receiving notification emails like this one, please contact
coheigea@apache.org.

Mime
View raw message