Skip to content

Commit 4245153

Browse files
committed
8277424: javax/net/ssl/TLSCommon/TLSTest.java fails with connection refused
Backport-of: 6b553acbaace0a61203305f36f70bb74d14a234f
1 parent 2f33cec commit 4245153

File tree

1 file changed

+58
-58
lines changed

1 file changed

+58
-58
lines changed

test/jdk/javax/net/ssl/TLSCommon/TLSTest.java

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -52,91 +52,91 @@
5252
* @test
5353
* @bug 8205111
5454
* @summary Test TLS with different types of supported keys.
55-
* @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha1 TLS_AES_128_GCM_SHA256
56-
* @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha256 TLS_AES_128_GCM_SHA256
57-
* @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha384 TLS_AES_128_GCM_SHA256
58-
* @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha512 TLS_AES_128_GCM_SHA256
59-
* @run main/othervm TLSTest TLSv1.3 ec_rsa_pkcs1_sha256 TLS_AES_128_GCM_SHA256
60-
* @run main/othervm TLSTest TLSv1.3 ecdsa_sha1 TLS_AES_128_GCM_SHA256
61-
* @run main/othervm TLSTest TLSv1.3 ecdsa_secp384r1_sha384
55+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha1 TLS_AES_128_GCM_SHA256
56+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha256 TLS_AES_128_GCM_SHA256
57+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha384 TLS_AES_128_GCM_SHA256
58+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha512 TLS_AES_128_GCM_SHA256
59+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ec_rsa_pkcs1_sha256 TLS_AES_128_GCM_SHA256
60+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ecdsa_sha1 TLS_AES_128_GCM_SHA256
61+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ecdsa_secp384r1_sha384
6262
* TLS_AES_128_GCM_SHA256
63-
* @run main/othervm TLSTest TLSv1.3 ecdsa_secp521r1_sha512
63+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ecdsa_secp521r1_sha512
6464
* TLS_AES_128_GCM_SHA256
65-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha256 TLS_AES_128_GCM_SHA256
66-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha384 TLS_AES_128_GCM_SHA256
67-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha512 TLS_AES_128_GCM_SHA256
68-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha256 TLS_AES_128_GCM_SHA256
69-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha384 TLS_AES_128_GCM_SHA256
70-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha512 TLS_AES_128_GCM_SHA256
65+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_rsae_sha256 TLS_AES_128_GCM_SHA256
66+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_rsae_sha384 TLS_AES_128_GCM_SHA256
67+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_rsae_sha512 TLS_AES_128_GCM_SHA256
68+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_pss_sha256 TLS_AES_128_GCM_SHA256
69+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_pss_sha384 TLS_AES_128_GCM_SHA256
70+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_pss_sha512 TLS_AES_128_GCM_SHA256
7171
*
72-
* @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha1 TLS_AES_256_GCM_SHA384
73-
* @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha256 TLS_AES_256_GCM_SHA384
74-
* @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha384 TLS_AES_256_GCM_SHA384
75-
* @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha512 TLS_AES_256_GCM_SHA384
76-
* @run main/othervm TLSTest TLSv1.3 ec_rsa_pkcs1_sha256 TLS_AES_256_GCM_SHA384
77-
* @run main/othervm TLSTest TLSv1.3 ecdsa_sha1 TLS_AES_256_GCM_SHA384
78-
* @run main/othervm TLSTest TLSv1.3 ecdsa_secp384r1_sha384
72+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha1 TLS_AES_256_GCM_SHA384
73+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha256 TLS_AES_256_GCM_SHA384
74+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha384 TLS_AES_256_GCM_SHA384
75+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha512 TLS_AES_256_GCM_SHA384
76+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ec_rsa_pkcs1_sha256 TLS_AES_256_GCM_SHA384
77+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ecdsa_sha1 TLS_AES_256_GCM_SHA384
78+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ecdsa_secp384r1_sha384
7979
* TLS_AES_256_GCM_SHA384
80-
* @run main/othervm TLSTest TLSv1.3 ecdsa_secp521r1_sha512
80+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ecdsa_secp521r1_sha512
8181
* TLS_AES_256_GCM_SHA384
82-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha256 TLS_AES_256_GCM_SHA384
83-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha384 TLS_AES_256_GCM_SHA384
84-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha512 TLS_AES_256_GCM_SHA384
85-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha256 TLS_AES_256_GCM_SHA384
86-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha384 TLS_AES_256_GCM_SHA384
87-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha512 TLS_AES_256_GCM_SHA384
82+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_rsae_sha256 TLS_AES_256_GCM_SHA384
83+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_rsae_sha384 TLS_AES_256_GCM_SHA384
84+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_rsae_sha512 TLS_AES_256_GCM_SHA384
85+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_pss_sha256 TLS_AES_256_GCM_SHA384
86+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_pss_sha384 TLS_AES_256_GCM_SHA384
87+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_pss_sha512 TLS_AES_256_GCM_SHA384
8888
*
89-
* @run main/othervm TLSTest TLSv1.2 rsa_pkcs1_sha1 TLS_RSA_WITH_AES_128_CBC_SHA
90-
* @run main/othervm TLSTest TLSv1.2 rsa_pkcs1_sha256
89+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pkcs1_sha1 TLS_RSA_WITH_AES_128_CBC_SHA
90+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pkcs1_sha256
9191
* TLS_RSA_WITH_AES_128_CBC_SHA
92-
* @run main/othervm TLSTest TLSv1.2 rsa_pkcs1_sha384
92+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pkcs1_sha384
9393
* TLS_RSA_WITH_AES_256_GCM_SHA384
94-
* @run main/othervm TLSTest TLSv1.2 rsa_pkcs1_sha512
94+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pkcs1_sha512
9595
* TLS_RSA_WITH_AES_128_GCM_SHA256
96-
* @run main/othervm TLSTest TLSv1.2 ec_rsa_pkcs1_sha256
96+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 ec_rsa_pkcs1_sha256
9797
* TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
98-
* @run main/othervm TLSTest TLSv1.2 ecdsa_sha1
98+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 ecdsa_sha1
9999
* TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
100-
* @run main/othervm TLSTest TLSv1.2 ecdsa_secp384r1_sha384
100+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 ecdsa_secp384r1_sha384
101101
* TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
102-
* @run main/othervm TLSTest TLSv1.2 ecdsa_secp521r1_sha512
102+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 ecdsa_secp521r1_sha512
103103
* TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
104-
* @run main/othervm TLSTest TLSv1.2 rsa_pss_rsae_sha256
104+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pss_rsae_sha256
105105
* TLS_RSA_WITH_AES_256_CBC_SHA256
106-
* @run main/othervm TLSTest TLSv1.2 rsa_pss_rsae_sha384
106+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pss_rsae_sha384
107107
* TLS_RSA_WITH_AES_256_CBC_SHA
108-
* @run main/othervm TLSTest TLSv1.2 rsa_pss_rsae_sha512
108+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pss_rsae_sha512
109109
* TLS_RSA_WITH_AES_128_CBC_SHA256
110-
* @run main/othervm TLSTest TLSv1.2 rsa_pss_pss_sha256
110+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pss_pss_sha256
111111
* TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
112-
* @run main/othervm TLSTest TLSv1.2 rsa_pss_pss_sha384
112+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pss_pss_sha384
113113
* TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
114-
* @run main/othervm TLSTest TLSv1.2 rsa_pss_pss_sha512
114+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pss_pss_sha512
115115
* TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
116116
*
117-
* @run main/othervm TLSTest TLSv1.1 rsa_pkcs1_sha1 TLS_RSA_WITH_AES_128_CBC_SHA
118-
* @run main/othervm TLSTest TLSv1.1 rsa_pkcs1_sha256
117+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.1 rsa_pkcs1_sha1 TLS_RSA_WITH_AES_128_CBC_SHA
118+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.1 rsa_pkcs1_sha256
119119
* TLS_RSA_WITH_AES_256_CBC_SHA
120-
* @run main/othervm TLSTest TLSv1.1 rsa_pkcs1_sha384
120+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.1 rsa_pkcs1_sha384
121121
* TLS_RSA_WITH_AES_128_CBC_SHA
122-
* @run main/othervm TLSTest TLSv1.1 rsa_pkcs1_sha512
122+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.1 rsa_pkcs1_sha512
123123
* TLS_RSA_WITH_AES_256_CBC_SHA
124-
* @run main/othervm TLSTest TLSv1.1 rsa_pss_rsae_sha256
124+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.1 rsa_pss_rsae_sha256
125125
* TLS_RSA_WITH_AES_128_CBC_SHA
126-
* @run main/othervm TLSTest TLSv1.1 rsa_pss_rsae_sha384
126+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.1 rsa_pss_rsae_sha384
127127
* TLS_RSA_WITH_AES_256_CBC_SHA
128-
* @run main/othervm TLSTest TLSv1.1 rsa_pss_rsae_sha512
128+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.1 rsa_pss_rsae_sha512
129129
* TLS_RSA_WITH_AES_128_CBC_SHA
130130
*
131-
* @run main/othervm TLSTest TLSv1 rsa_pkcs1_sha1 TLS_RSA_WITH_AES_128_CBC_SHA
132-
* @run main/othervm TLSTest TLSv1 rsa_pkcs1_sha256 TLS_RSA_WITH_AES_256_CBC_SHA
133-
* @run main/othervm TLSTest TLSv1 rsa_pkcs1_sha384 TLS_RSA_WITH_AES_128_CBC_SHA
134-
* @run main/othervm TLSTest TLSv1 rsa_pkcs1_sha512 TLS_RSA_WITH_AES_256_CBC_SHA
135-
* @run main/othervm TLSTest TLSv1 rsa_pss_rsae_sha256
131+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1 rsa_pkcs1_sha1 TLS_RSA_WITH_AES_128_CBC_SHA
132+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1 rsa_pkcs1_sha256 TLS_RSA_WITH_AES_256_CBC_SHA
133+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1 rsa_pkcs1_sha384 TLS_RSA_WITH_AES_128_CBC_SHA
134+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1 rsa_pkcs1_sha512 TLS_RSA_WITH_AES_256_CBC_SHA
135+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1 rsa_pss_rsae_sha256
136136
* TLS_RSA_WITH_AES_128_CBC_SHA
137-
* @run main/othervm TLSTest TLSv1 rsa_pss_rsae_sha384
137+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1 rsa_pss_rsae_sha384
138138
* TLS_RSA_WITH_AES_256_CBC_SHA
139-
* @run main/othervm TLSTest TLSv1 rsa_pss_rsae_sha512
139+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1 rsa_pss_rsae_sha512
140140
* TLS_RSA_WITH_AES_128_CBC_SHA
141141
*/
142142
public class TLSTest {
@@ -281,7 +281,7 @@ void doClientSide() throws Exception {
281281
keyType.getTrustedCert(), null, null, keyType.getKeyType());
282282
SSLSocketFactory sslsf = ctx.getSocketFactory();
283283
try (SSLSocket sslSocket
284-
= (SSLSocket) sslsf.createSocket("localhost", serverPort)) {
284+
= (SSLSocket) sslsf.createSocket(InetAddress.getLoopbackAddress(), serverPort)) {
285285
// Specify the client cipher suites
286286
sslSocket.setEnabledCipherSuites(new String[]{this.cipher});
287287
sslSocket.setEnabledProtocols(new String[]{this.tlsProtocol});

0 commit comments

Comments
 (0)