Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ADEA317D79 for ; Tue, 12 May 2015 15:40:13 +0000 (UTC) Received: (qmail 41799 invoked by uid 500); 12 May 2015 15:40:13 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 41742 invoked by uid 500); 12 May 2015 15:40:13 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 41732 invoked by uid 99); 12 May 2015 15:40:13 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 May 2015 15:40:13 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 613A2E03C7; Tue, 12 May 2015 15:40:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: coheigea@apache.org To: commits@cxf.apache.org Date: Tue, 12 May 2015 15:40:13 -0000 Message-Id: <96b9855d98dd49f197763c9de1349f6d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/6] cxf git commit: Adding some TLSv1.1 and TLSv1.0 client tests Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 6e4f66e2c -> cadb4e5a1 Adding some TLSv1.1 and TLSv1.0 client tests Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/27596ba4 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/27596ba4 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/27596ba4 Branch: refs/heads/3.0.x-fixes Commit: 27596ba465ee4438a4d60836c6fe6e5af05cca30 Parents: 6e4f66e Author: Colm O hEigeartaigh Authored: Mon May 11 16:19:16 2015 +0100 Committer: Colm O hEigeartaigh Committed: Tue May 12 16:32:04 2015 +0100 ---------------------------------------------------------------------- .../https/ciphersuites/CipherSuitesTest.java | 76 ++++++++++++++++++++ 1 file changed, 76 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/27596ba4/systests/transports/src/test/java/org/apache/cxf/systest/https/ciphersuites/CipherSuitesTest.java ---------------------------------------------------------------------- diff --git a/systests/transports/src/test/java/org/apache/cxf/systest/https/ciphersuites/CipherSuitesTest.java b/systests/transports/src/test/java/org/apache/cxf/systest/https/ciphersuites/CipherSuitesTest.java index c363cc7..e66504a 100644 --- a/systests/transports/src/test/java/org/apache/cxf/systest/https/ciphersuites/CipherSuitesTest.java +++ b/systests/transports/src/test/java/org/apache/cxf/systest/https/ciphersuites/CipherSuitesTest.java @@ -527,6 +527,82 @@ public class CipherSuitesTest extends AbstractBusClientServerTestBase { bus.shutdown(true); } + // Both client + server include AES, client is TLSv1.1 + @org.junit.Test + public void testAESIncludedTLSv11() throws Exception { + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = CipherSuitesTest.class.getResource("ciphersuites-client-noconfig.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); + + Client client = ClientProxy.getClient(port); + HTTPConduit conduit = (HTTPConduit) client.getConduit(); + + TLSClientParameters tlsParams = new TLSClientParameters(); + X509TrustManager trustManager = new NoOpX509TrustManager(); + TrustManager[] trustManagers = new TrustManager[1]; + trustManagers[0] = trustManager; + tlsParams.setTrustManagers(trustManagers); + tlsParams.setDisableCNCheck(true); + + tlsParams.setSecureSocketProtocol("TLSv1.1"); + + conduit.setTlsClientParameters(tlsParams); + + assertEquals(port.greetMe("Kitty"), "Hello Kitty"); + + ((java.io.Closeable)port).close(); + bus.shutdown(true); + } + + // Both client + server include AES, client is TLSv1.0 + @org.junit.Test + public void testAESIncludedTLSv10() throws Exception { + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = CipherSuitesTest.class.getResource("ciphersuites-client-noconfig.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); + + Client client = ClientProxy.getClient(port); + HTTPConduit conduit = (HTTPConduit) client.getConduit(); + + TLSClientParameters tlsParams = new TLSClientParameters(); + X509TrustManager trustManager = new NoOpX509TrustManager(); + TrustManager[] trustManagers = new TrustManager[1]; + trustManagers[0] = trustManager; + tlsParams.setTrustManagers(trustManagers); + tlsParams.setDisableCNCheck(true); + + tlsParams.setSecureSocketProtocol("TLSv1"); + + conduit.setTlsClientParameters(tlsParams); + + assertEquals(port.greetMe("Kitty"), "Hello Kitty"); + + ((java.io.Closeable)port).close(); + bus.shutdown(true); + } + private static class NoOpX509TrustManager implements X509TrustManager { public NoOpX509TrustManager() {