Skip to content

Commit

Permalink
jakartaee#625 Fix 4 webservices12/sec failures due to TLS protocol
Browse files Browse the repository at this point in the history
Use client.cert.test.jdk.tls.client.protocols to set https.protocols property

Signed-off-by: hussainnm <hussain.nm@cognizant.com>
  • Loading branch information
hussainnm committed Mar 22, 2021
1 parent 5d6811d commit 30931ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -68,6 +68,11 @@ public void setup(String[] args, Properties p) throws Fault {
try {
hostname = props.getProperty("webServerHost");
portnum = Integer.parseInt(props.getProperty("securedWebServicePort"));
String tlsVersion = p.getProperty("client.cert.test.jdk.tls.client.protocols");
if (tlsVersion != null) {
TestUtil.logMsg("client.cert.test.jdk.tls.client.protocols=" + tlsVersion);
System.setProperty("https.protocols", tlsVersion);
}
urlString = ctsurl.getURLString(PROTOCOL, hostname, portnum,
"/WSEjbClientCert/HelloService/Hello");
HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -78,6 +78,11 @@ public void setup(String[] args, Properties p) throws Fault {
try {
hostname = p.getProperty("webServerHost");
portnum = Integer.parseInt(p.getProperty("securedWebServicePort"));
String tlsVersion = p.getProperty("client.cert.test.jdk.tls.client.protocols");
if (tlsVersion != null) {
TestUtil.logMsg("client.cert.test.jdk.tls.client.protocols=" + tlsVersion);
System.setProperty("https.protocols", tlsVersion);
}
urlString = ctsurl.getURLString(PROTOCOL, hostname, portnum,
"/WSSecEjbCertificate/ejb");
HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
Expand Down

0 comments on commit 30931ee

Please sign in to comment.