Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes cb3b8ba1d -> 44dbe461f


Adding some more comprehensive client authentication TLS tests


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

Branch: refs/heads/3.0.x-fixes
Commit: 44dbe461f938664aa8ef4c1bcef8929b5bd453cf
Parents: cb3b8ba
Author: Colm O hEigeartaigh <cohei...@apache.org>
Authored: Fri Dec 12 12:51:33 2014 +0000
Committer: Colm O hEigeartaigh <cohei...@apache.org>
Committed: Fri Dec 12 12:56:57 2014 +0000

----------------------------------------------------------------------
 .../cxf/systest/https/ClientAuthServer.java     |  47 ++++
 .../cxf/systest/https/ClientAuthTest.java       | 246 +++++++++++++++++++
 .../src/test/resources/keys/alice.jks           | Bin 0 -> 2428 bytes
 .../transports/src/test/resources/keys/bob.jks  | Bin 0 -> 2422 bytes
 .../src/test/resources/keys/cxfca.jks           | Bin 0 -> 1306 bytes
 .../cxf/systest/https/client-auth-chain.xml     |  37 +++
 .../cxf/systest/https/client-auth-invalid.xml   |  36 +++
 .../cxf/systest/https/client-auth-invalid2.xml  |  36 +++
 .../cxf/systest/https/client-auth-server.xml    |  72 ++++++
 .../apache/cxf/systest/https/client-auth.xml    |  37 +++
 10 files changed, 511 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/44dbe461/systests/transports/src/test/java/org/apache/cxf/systest/https/ClientAuthServer.java
----------------------------------------------------------------------
diff --git 
a/systests/transports/src/test/java/org/apache/cxf/systest/https/ClientAuthServer.java
 
b/systests/transports/src/test/java/org/apache/cxf/systest/https/ClientAuthServer.java
new file mode 100644
index 0000000..5108a22
--- /dev/null
+++ 
b/systests/transports/src/test/java/org/apache/cxf/systest/https/ClientAuthServer.java
@@ -0,0 +1,47 @@
+/**
+ * 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.
+ */
+
+package org.apache.cxf.systest.https;
+
+import java.net.URL;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+
+public class ClientAuthServer extends AbstractBusTestServerBase {
+
+    public ClientAuthServer() {
+
+    }
+
+    protected void run()  {
+        URL busFile = Server.class.getResource("client-auth-server.xml");
+        Bus busLocal = new SpringBusFactory().createBus(busFile);
+        BusFactory.setDefaultBus(busLocal);
+        setBus(busLocal);
+
+        try {
+            new ClientAuthServer();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/44dbe461/systests/transports/src/test/java/org/apache/cxf/systest/https/ClientAuthTest.java
----------------------------------------------------------------------
diff --git 
a/systests/transports/src/test/java/org/apache/cxf/systest/https/ClientAuthTest.java
 
b/systests/transports/src/test/java/org/apache/cxf/systest/https/ClientAuthTest.java
new file mode 100644
index 0000000..387a508
--- /dev/null
+++ 
b/systests/transports/src/test/java/org/apache/cxf/systest/https/ClientAuthTest.java
@@ -0,0 +1,246 @@
+/**
+ * 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.
+ */
+
+package org.apache.cxf.systest.https;
+
+import java.net.URL;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.apache.hello_world.Greeter;
+import org.apache.hello_world.services.SOAPService;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+
+/**
+ * A set of tests for TLS client authentication.
+ */
+public class ClientAuthTest extends AbstractBusClientServerTestBase {
+    static final String PORT = allocatePort(ClientAuthServer.class);
+    static final String PORT2 = allocatePort(ClientAuthServer.class, 2);
+    
+    @BeforeClass
+    public static void startServers() throws Exception {
+        assertTrue(
+            "Server failed to launch",
+            // run the server in the same process
+            // set this to false to fork
+            launchServer(ClientAuthServer.class, true)
+        );
+    }
+    
+    @AfterClass
+    public static void cleanup() throws Exception {
+        stopAllServers();
+    }
+
+    // Server directly trusts the client cert
+    @org.junit.Test
+    public void testDirectTrust() throws Exception {
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = ClientAuthTest.class.getResource("client-auth.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+        
+        URL url = SOAPService.WSDL_LOCATION;
+        SOAPService service = new SOAPService(url, SOAPService.SERVICE);
+        assertNotNull("Service is null", service);   
+        final Greeter port = service.getHttpsPort();
+        assertNotNull("Port is null", port);
+        
+        updateAddressPort(port, PORT);
+        
+        assertEquals(port.greetMe("Kitty"), "Hello Kitty");
+        
+        ((java.io.Closeable)port).close();
+        bus.shutdown(true);
+    }
+    
+    // Server does not (directly) trust the client cert
+    @org.junit.Test
+    public void testInvalidDirectTrust() throws Exception {
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = 
ClientAuthTest.class.getResource("client-auth-invalid.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+        
+        URL url = SOAPService.WSDL_LOCATION;
+        SOAPService service = new SOAPService(url, SOAPService.SERVICE);
+        assertNotNull("Service is null", service);   
+        final Greeter port = service.getHttpsPort();
+        assertNotNull("Port is null", port);
+        
+        updateAddressPort(port, PORT);
+        
+        try {
+            port.greetMe("Kitty");
+            fail("Failure expected on an untrusted cert");
+        } catch (Exception ex) {
+            // expected
+        }
+        
+        ((java.io.Closeable)port).close();
+        bus.shutdown(true);
+    }
+    
+    // Client does not specify a KeyStore, only a TrustStore
+    @org.junit.Test
+    public void testNoClientCert() throws Exception {
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = ClientAuthTest.class.getResource("sslv3-client.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+        
+        URL url = SOAPService.WSDL_LOCATION;
+        SOAPService service = new SOAPService(url, SOAPService.SERVICE);
+        assertNotNull("Service is null", service);   
+        final Greeter port = service.getHttpsPort();
+        assertNotNull("Port is null", port);
+        
+        updateAddressPort(port, PORT);
+        
+        try {
+            port.greetMe("Kitty");
+            fail("Failure expected on no trusted cert");
+        } catch (Exception ex) {
+            // expected
+        }
+        
+        ((java.io.Closeable)port).close();
+        bus.shutdown(true);
+    }
+    
+    // Server trusts the issuer of the client cert
+    @org.junit.Test
+    public void testChainTrust() throws Exception {
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = 
ClientAuthTest.class.getResource("client-auth-chain.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+        
+        URL url = SOAPService.WSDL_LOCATION;
+        SOAPService service = new SOAPService(url, SOAPService.SERVICE);
+        assertNotNull("Service is null", service);   
+        final Greeter port = service.getHttpsPort();
+        assertNotNull("Port is null", port);
+        
+        updateAddressPort(port, PORT2);
+        
+        assertEquals(port.greetMe("Kitty"), "Hello Kitty");
+        
+        ((java.io.Closeable)port).close();
+        bus.shutdown(true);
+    }
+    
+    // Server does not trust the issuer of the client cert
+    @org.junit.Test
+    public void testInvalidChainTrust() throws Exception {
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = 
ClientAuthTest.class.getResource("client-auth-invalid2.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+        
+        URL url = SOAPService.WSDL_LOCATION;
+        SOAPService service = new SOAPService(url, SOAPService.SERVICE);
+        assertNotNull("Service is null", service);   
+        final Greeter port = service.getHttpsPort();
+        assertNotNull("Port is null", port);
+        
+        updateAddressPort(port, PORT2);
+        
+        try {
+            port.greetMe("Kitty");
+            fail("Failure expected on no trusted cert");
+        } catch (Exception ex) {
+            // expected
+        }
+        
+        ((java.io.Closeable)port).close();
+        bus.shutdown(true);
+    }
+    
+    // Client does not trust the issuer of the server cert
+    @org.junit.Test
+    public void testClientInvalidCertChain() throws Exception {
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = 
ClientAuthTest.class.getResource("client-auth-invalid2.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+        
+        URL url = SOAPService.WSDL_LOCATION;
+        SOAPService service = new SOAPService(url, SOAPService.SERVICE);
+        assertNotNull("Service is null", service);   
+        final Greeter port = service.getHttpsPort();
+        assertNotNull("Port is null", port);
+        
+        updateAddressPort(port, PORT);
+        
+        try {
+            port.greetMe("Kitty");
+            fail("Failure expected on no trusted cert");
+        } catch (Exception ex) {
+            // expected
+        }
+        
+        ((java.io.Closeable)port).close();
+        bus.shutdown(true);
+    }
+    
+    // Client does not directly trust the server cert
+    @org.junit.Test
+    public void testClientInvalidDirectTrust() throws Exception {
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = 
ClientAuthTest.class.getResource("client-auth-invalid.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+        
+        URL url = SOAPService.WSDL_LOCATION;
+        SOAPService service = new SOAPService(url, SOAPService.SERVICE);
+        assertNotNull("Service is null", service);   
+        final Greeter port = service.getHttpsPort();
+        assertNotNull("Port is null", port);
+        
+        updateAddressPort(port, PORT2);
+        
+        try {
+            port.greetMe("Kitty");
+            fail("Failure expected on no trusted cert");
+        } catch (Exception ex) {
+            // expected
+        }
+        
+        ((java.io.Closeable)port).close();
+        bus.shutdown(true);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/44dbe461/systests/transports/src/test/resources/keys/alice.jks
----------------------------------------------------------------------
diff --git a/systests/transports/src/test/resources/keys/alice.jks 
b/systests/transports/src/test/resources/keys/alice.jks
new file mode 100644
index 0000000..9f47a5c
Binary files /dev/null and 
b/systests/transports/src/test/resources/keys/alice.jks differ

http://git-wip-us.apache.org/repos/asf/cxf/blob/44dbe461/systests/transports/src/test/resources/keys/bob.jks
----------------------------------------------------------------------
diff --git a/systests/transports/src/test/resources/keys/bob.jks 
b/systests/transports/src/test/resources/keys/bob.jks
new file mode 100644
index 0000000..26df583
Binary files /dev/null and 
b/systests/transports/src/test/resources/keys/bob.jks differ

http://git-wip-us.apache.org/repos/asf/cxf/blob/44dbe461/systests/transports/src/test/resources/keys/cxfca.jks
----------------------------------------------------------------------
diff --git a/systests/transports/src/test/resources/keys/cxfca.jks 
b/systests/transports/src/test/resources/keys/cxfca.jks
new file mode 100644
index 0000000..accd45b
Binary files /dev/null and 
b/systests/transports/src/test/resources/keys/cxfca.jks differ

http://git-wip-us.apache.org/repos/asf/cxf/blob/44dbe461/systests/transports/src/test/resources/org/apache/cxf/systest/https/client-auth-chain.xml
----------------------------------------------------------------------
diff --git 
a/systests/transports/src/test/resources/org/apache/cxf/systest/https/client-auth-chain.xml
 
b/systests/transports/src/test/resources/org/apache/cxf/systest/https/client-auth-chain.xml
new file mode 100644
index 0000000..68b0b46
--- /dev/null
+++ 
b/systests/transports/src/test/resources/org/apache/cxf/systest/https/client-auth-chain.xml
@@ -0,0 +1,37 @@
+<?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-beans.xsd           
http://cxf.apache.org/jaxws                           
http://cxf.apache.org/schemas/jaxws.xsd           
http://cxf.apache.org/transports/http/configuration   
http://cxf.apache.org/schemas/configuration/http-conf.xsd           
http://cxf.apache.org/configuration/security          
http://cxf.apache.org/schemas/configuration/security.xsd           
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd           
http://cxf.apache.org/policy http://cxf.apache.org/schemas/poli
 cy.xsd">
+    
+    <cxf:bus>
+        <cxf:features>
+            <cxf:logging/>
+        </cxf:features>
+    </cxf:bus>
+    <http:conduit name="https://localhost:.*";>
+        <http:tlsClientParameters disableCNCheck="true">
+            <sec:keyManagers keyPassword="password">
+                <sec:keyStore type="jks" password="password" 
resource="keys/alice.jks"/>
+            </sec:keyManagers>
+            <sec:trustManagers>
+                <sec:keyStore type="jks" password="password" 
resource="keys/cxfca.jks"/>
+            </sec:trustManagers>
+        </http:tlsClientParameters>
+    </http:conduit>
+</beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/44dbe461/systests/transports/src/test/resources/org/apache/cxf/systest/https/client-auth-invalid.xml
----------------------------------------------------------------------
diff --git 
a/systests/transports/src/test/resources/org/apache/cxf/systest/https/client-auth-invalid.xml
 
b/systests/transports/src/test/resources/org/apache/cxf/systest/https/client-auth-invalid.xml
new file mode 100644
index 0000000..132c550
--- /dev/null
+++ 
b/systests/transports/src/test/resources/org/apache/cxf/systest/https/client-auth-invalid.xml
@@ -0,0 +1,36 @@
+<?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-beans.xsd           
http://cxf.apache.org/jaxws                           
http://cxf.apache.org/schemas/jaxws.xsd           
http://cxf.apache.org/transports/http/configuration   
http://cxf.apache.org/schemas/configuration/http-conf.xsd           
http://cxf.apache.org/configuration/security          
http://cxf.apache.org/schemas/configuration/security.xsd           
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd           
http://cxf.apache.org/policy http://cxf.apache.org/schemas/poli
 cy.xsd">
+    <cxf:bus>
+        <cxf:features>
+            <cxf:logging/>
+        </cxf:features>
+    </cxf:bus>
+    <http:conduit name="https://localhost:.*";>
+        <http:tlsClientParameters disableCNCheck="true">
+            <sec:keyManagers keyPassword="password">
+                <sec:keyStore type="jks" password="password" 
resource="keys/alice.jks"/>
+            </sec:keyManagers>
+            <sec:trustManagers>
+                <sec:keyStore type="jks" password="password" 
resource="keys/Truststore.jks"/>
+            </sec:trustManagers>
+        </http:tlsClientParameters>
+    </http:conduit>
+</beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/44dbe461/systests/transports/src/test/resources/org/apache/cxf/systest/https/client-auth-invalid2.xml
----------------------------------------------------------------------
diff --git 
a/systests/transports/src/test/resources/org/apache/cxf/systest/https/client-auth-invalid2.xml
 
b/systests/transports/src/test/resources/org/apache/cxf/systest/https/client-auth-invalid2.xml
new file mode 100644
index 0000000..5937fa2
--- /dev/null
+++ 
b/systests/transports/src/test/resources/org/apache/cxf/systest/https/client-auth-invalid2.xml
@@ -0,0 +1,36 @@
+<?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-beans.xsd           
http://cxf.apache.org/jaxws                           
http://cxf.apache.org/schemas/jaxws.xsd           
http://cxf.apache.org/transports/http/configuration   
http://cxf.apache.org/schemas/configuration/http-conf.xsd           
http://cxf.apache.org/configuration/security          
http://cxf.apache.org/schemas/configuration/security.xsd           
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd           
http://cxf.apache.org/policy http://cxf.apache.org/schemas/poli
 cy.xsd">
+    <cxf:bus>
+        <cxf:features>
+            <cxf:logging/>
+        </cxf:features>
+    </cxf:bus>
+    <http:conduit name="https://localhost:.*";>
+        <http:tlsClientParameters disableCNCheck="true">
+            <sec:keyManagers keyPassword="password">
+                <sec:keyStore type="jks" password="password" 
resource="keys/Morpit.jks"/>
+            </sec:keyManagers>
+            <sec:trustManagers>
+                <sec:keyStore type="jks" password="password" 
resource="keys/cxfca.jks"/>
+            </sec:trustManagers>
+        </http:tlsClientParameters>
+    </http:conduit>
+</beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/44dbe461/systests/transports/src/test/resources/org/apache/cxf/systest/https/client-auth-server.xml
----------------------------------------------------------------------
diff --git 
a/systests/transports/src/test/resources/org/apache/cxf/systest/https/client-auth-server.xml
 
b/systests/transports/src/test/resources/org/apache/cxf/systest/https/client-auth-server.xml
new file mode 100644
index 0000000..9b632da
--- /dev/null
+++ 
b/systests/transports/src/test/resources/org/apache/cxf/systest/https/client-auth-server.xml
@@ -0,0 +1,72 @@
+<?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:jaxws="http://cxf.apache.org/jaxws"; 
xmlns:http="http://cxf.apache.org/transports/http/configuration"; 
xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"; 
xmlns:sec="http://cxf.apache.org/configuration/security"; 
xmlns:cxf="http://cxf.apache.org/core"; xmlns:p="http://cxf.apache.org/policy"; 
xsi:schemaLocation="         http://www.springframework.org/schema/beans        
             http://www.springframework.org/schema/beans/spring-beans.xsd       
  http://cxf.apache.org/jaxws                                     
http://cxf.apache.org/schemas/jaxws.xsd         http://cxf.apache.org/core 
http://cxf.apache.org/schemas/core.xsd         http://cxf.apache.org/policy 
http://cxf.apache.org/schemas/policy.xsd         
http://cxf.apache.org/transports/http/configuration             
http://cxf.apache.org/schemas/configuration/http-conf.xsd         http://cxf.apa
 che.org/transports/http-jetty/configuration       
http://cxf.apache.org/schemas/configuration/http-jetty.xsd         
http://cxf.apache.org/configuration/security                    
http://cxf.apache.org/schemas/configuration/security.xsd     ">
+    <bean 
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+    <cxf:bus>
+        <cxf:features>
+            <cxf:logging/>
+        </cxf:features>
+    </cxf:bus>
+   
+    <httpj:engine-factory id="direct-trust-tls-settings">
+        <httpj:engine port="${testutil.ports.ClientAuthServer}">
+            <httpj:tlsServerParameters>
+                <sec:keyManagers keyPassword="password">
+                    <sec:keyStore type="jks" password="password" 
resource="keys/Bethal.jks"/>
+                </sec:keyManagers>
+                <sec:trustManagers>
+                    <sec:keyStore type="jks" password="password" 
resource="keys/Truststore.jks"/>
+                </sec:trustManagers>
+                <sec:clientAuthentication want="true" required="true"/>
+            </httpj:tlsServerParameters>
+        </httpj:engine>
+    </httpj:engine-factory>
+    
+    <jaxws:endpoint xmlns:e="http://apache.org/hello_world/services"; 
+                     xmlns:s="http://apache.org/hello_world/services"; 
+                     id="DirectTrustServer" 
+                     implementor="org.apache.cxf.systest.http.GreeterImpl" 
+                     
address="https://localhost:${testutil.ports.ClientAuthServer}/SoapContext/HttpsPort";
 
+                     serviceName="s:SOAPService" 
+                     endpointName="e:HttpsPort" 
depends-on="direct-trust-tls-settings"/>
+    
+     <httpj:engine-factory id="chain-trust-tls-settings">
+        <httpj:engine port="${testutil.ports.ClientAuthServer.2}">
+            <httpj:tlsServerParameters>
+                <sec:keyManagers keyPassword="password">
+                    <sec:keyStore type="jks" password="password" 
resource="keys/bob.jks"/>
+                </sec:keyManagers>
+                <sec:trustManagers>
+                    <sec:keyStore type="jks" password="password" 
resource="keys/cxfca.jks"/>
+                </sec:trustManagers>
+                <sec:clientAuthentication want="true" required="true"/>
+            </httpj:tlsServerParameters>
+        </httpj:engine>
+    </httpj:engine-factory>
+    
+    <jaxws:endpoint xmlns:e="http://apache.org/hello_world/services"; 
+                     xmlns:s="http://apache.org/hello_world/services"; 
+                     id="ChainTrustServer" 
+                     implementor="org.apache.cxf.systest.http.GreeterImpl" 
+                     
address="https://localhost:${testutil.ports.ClientAuthServer.2}/SoapContext/HttpsPort";
 
+                     serviceName="s:SOAPService" 
+                     endpointName="e:HttpsPort" 
depends-on="chain-trust-tls-settings"/>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/44dbe461/systests/transports/src/test/resources/org/apache/cxf/systest/https/client-auth.xml
----------------------------------------------------------------------
diff --git 
a/systests/transports/src/test/resources/org/apache/cxf/systest/https/client-auth.xml
 
b/systests/transports/src/test/resources/org/apache/cxf/systest/https/client-auth.xml
new file mode 100644
index 0000000..8020e3e
--- /dev/null
+++ 
b/systests/transports/src/test/resources/org/apache/cxf/systest/https/client-auth.xml
@@ -0,0 +1,37 @@
+<?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-beans.xsd           
http://cxf.apache.org/jaxws                           
http://cxf.apache.org/schemas/jaxws.xsd           
http://cxf.apache.org/transports/http/configuration   
http://cxf.apache.org/schemas/configuration/http-conf.xsd           
http://cxf.apache.org/configuration/security          
http://cxf.apache.org/schemas/configuration/security.xsd           
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd           
http://cxf.apache.org/policy http://cxf.apache.org/schemas/poli
 cy.xsd">
+    
+    <cxf:bus>
+        <cxf:features>
+            <cxf:logging/>
+        </cxf:features>
+    </cxf:bus>
+    <http:conduit name="https://localhost:.*";>
+        <http:tlsClientParameters disableCNCheck="true">
+            <sec:keyManagers keyPassword="password">
+                <sec:keyStore type="jks" password="password" 
resource="keys/Morpit.jks"/>
+            </sec:keyManagers>
+            <sec:trustManagers>
+                <sec:keyStore type="jks" password="password" 
resource="keys/Truststore.jks"/>
+            </sec:trustManagers>
+        </http:tlsClientParameters>
+    </http:conduit>
+</beans>

Reply via email to