From commits-return-49305-archive-asf-public=cust-asf.ponee.io@cxf.apache.org Wed Jun 6 21:30:54 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 34B09180718 for ; Wed, 6 Jun 2018 21:30:53 +0200 (CEST) Received: (qmail 67471 invoked by uid 500); 6 Jun 2018 19:30:52 -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 67254 invoked by uid 99); 6 Jun 2018 19:30:52 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jun 2018 19:30:52 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 2CB0C82A8D; Wed, 6 Jun 2018 19:30:51 +0000 (UTC) Date: Wed, 06 Jun 2018 19:30:51 +0000 To: "commits@cxf.apache.org" Subject: [cxf] 02/08: Adding disableCN tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: coheigea@apache.org In-Reply-To: <152831344987.2056.12137215378753174@gitbox.apache.org> References: <152831344987.2056.12137215378753174@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: cxf X-Git-Refname: refs/heads/3.1.x-fixes X-Git-Reftype: branch X-Git-Rev: 8411de987a05820d9d98279bd60e7373f6520ac4 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20180606193051.2CB0C82A8D@gitbox.apache.org> 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 8411de987a05820d9d98279bd60e7373f6520ac4 Author: Colm O hEigeartaigh AuthorDate: Wed Jun 6 11:25:11 2018 +0100 Adding disableCN tests (cherry picked from commit 61879e4e6dc65eca136ca74ec6a22c6f4024546d) # Conflicts: # systests/transports/src/test/java/org/apache/cxf/systest/https/hostname/HostnameVerificationTest.java --- .../HostnameVerificationDeprecatedTest.java | 24 +++++++++++++++ .../https/hostname/HostnameVerificationTest.java | 26 ++++++++++++++++- .../https/hostname/hostname-client-disablecn.xml | 34 ++++++++++++++++++++++ 3 files changed, 83 insertions(+), 1 deletion(-) 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 a9ea8a1..124a6dc 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 @@ -89,6 +89,30 @@ public class HostnameVerificationDeprecatedTest extends AbstractBusClientServerT bus.shutdown(true); } + // No Subject Alternative Name, no matching CN - but we are disabling the CN check so it should work OK + @org.junit.Test + public void testLocalhostNotMatchingDisableCN() throws Exception { + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = HostnameVerificationTest.class.getResource("hostname-client-disablecn.xml"); + + Bus bus = bf.createBus(busFile.toString()); + BusFactory.setDefaultBus(bus); + BusFactory.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); + + port.greetMe("Kitty"); + + ((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/java/org/apache/cxf/systest/https/hostname/HostnameVerificationTest.java b/systests/transports/src/test/java/org/apache/cxf/systest/https/hostname/HostnameVerificationTest.java index c55dccb..05a62e7 100644 --- a/systests/transports/src/test/java/org/apache/cxf/systest/https/hostname/HostnameVerificationTest.java +++ b/systests/transports/src/test/java/org/apache/cxf/systest/https/hostname/HostnameVerificationTest.java @@ -196,5 +196,29 @@ public class HostnameVerificationTest extends AbstractBusClientServerTestBase { ((java.io.Closeable)port).close(); bus.shutdown(true); } - + + // No Subject Alternative Name, no matching CN - but we are disabling the CN check so it should work OK + @org.junit.Test + public void testNoSubjectAlternativeNameNoCNMatchDisableCN() throws Exception { + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = HostnameVerificationTest.class.getResource("hostname-client-disablecn.xml"); + + Bus bus = bf.createBus(busFile.toString()); + BusFactory.setDefaultBus(bus); + BusFactory.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, PORT4); + + port.greetMe("Kitty"); + + ((java.io.Closeable)port).close(); + bus.shutdown(true); + } + } diff --git a/systests/transports/src/test/resources/org/apache/cxf/systest/https/hostname/hostname-client-disablecn.xml b/systests/transports/src/test/resources/org/apache/cxf/systest/https/hostname/hostname-client-disablecn.xml new file mode 100644 index 0000000..19c9471 --- /dev/null +++ b/systests/transports/src/test/resources/org/apache/cxf/systest/https/hostname/hostname-client-disablecn.xml @@ -0,0 +1,34 @@ + + + + + + + + + + -- To stop receiving notification emails like this one, please contact coheigea@apache.org.