Skip to content

Commit 6b553ac

Browse files
myankelevRajan Halade
authored andcommitted
8277424: javax/net/ssl/TLSCommon/TLSTest.java fails with connection refused
Reviewed-by: rhalade
1 parent 09cae5f commit 6b553ac

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
@@ -50,91 +50,91 @@
5050
* @test
5151
* @bug 8205111
5252
* @summary Test TLS with different types of supported keys.
53-
* @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha1 TLS_AES_128_GCM_SHA256
54-
* @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha256 TLS_AES_128_GCM_SHA256
55-
* @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha384 TLS_AES_128_GCM_SHA256
56-
* @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha512 TLS_AES_128_GCM_SHA256
57-
* @run main/othervm TLSTest TLSv1.3 ec_rsa_pkcs1_sha256 TLS_AES_128_GCM_SHA256
58-
* @run main/othervm TLSTest TLSv1.3 ecdsa_sha1 TLS_AES_128_GCM_SHA256
59-
* @run main/othervm TLSTest TLSv1.3 ecdsa_secp384r1_sha384
53+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha1 TLS_AES_128_GCM_SHA256
54+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha256 TLS_AES_128_GCM_SHA256
55+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha384 TLS_AES_128_GCM_SHA256
56+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha512 TLS_AES_128_GCM_SHA256
57+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ec_rsa_pkcs1_sha256 TLS_AES_128_GCM_SHA256
58+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ecdsa_sha1 TLS_AES_128_GCM_SHA256
59+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ecdsa_secp384r1_sha384
6060
* TLS_AES_128_GCM_SHA256
61-
* @run main/othervm TLSTest TLSv1.3 ecdsa_secp521r1_sha512
61+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ecdsa_secp521r1_sha512
6262
* TLS_AES_128_GCM_SHA256
63-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha256 TLS_AES_128_GCM_SHA256
64-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha384 TLS_AES_128_GCM_SHA256
65-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha512 TLS_AES_128_GCM_SHA256
66-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha256 TLS_AES_128_GCM_SHA256
67-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha384 TLS_AES_128_GCM_SHA256
68-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha512 TLS_AES_128_GCM_SHA256
63+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_rsae_sha256 TLS_AES_128_GCM_SHA256
64+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_rsae_sha384 TLS_AES_128_GCM_SHA256
65+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_rsae_sha512 TLS_AES_128_GCM_SHA256
66+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_pss_sha256 TLS_AES_128_GCM_SHA256
67+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_pss_sha384 TLS_AES_128_GCM_SHA256
68+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_pss_sha512 TLS_AES_128_GCM_SHA256
6969
*
70-
* @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha1 TLS_AES_256_GCM_SHA384
71-
* @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha256 TLS_AES_256_GCM_SHA384
72-
* @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha384 TLS_AES_256_GCM_SHA384
73-
* @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha512 TLS_AES_256_GCM_SHA384
74-
* @run main/othervm TLSTest TLSv1.3 ec_rsa_pkcs1_sha256 TLS_AES_256_GCM_SHA384
75-
* @run main/othervm TLSTest TLSv1.3 ecdsa_sha1 TLS_AES_256_GCM_SHA384
76-
* @run main/othervm TLSTest TLSv1.3 ecdsa_secp384r1_sha384
70+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha1 TLS_AES_256_GCM_SHA384
71+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha256 TLS_AES_256_GCM_SHA384
72+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha384 TLS_AES_256_GCM_SHA384
73+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pkcs1_sha512 TLS_AES_256_GCM_SHA384
74+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ec_rsa_pkcs1_sha256 TLS_AES_256_GCM_SHA384
75+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ecdsa_sha1 TLS_AES_256_GCM_SHA384
76+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ecdsa_secp384r1_sha384
7777
* TLS_AES_256_GCM_SHA384
78-
* @run main/othervm TLSTest TLSv1.3 ecdsa_secp521r1_sha512
78+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 ecdsa_secp521r1_sha512
7979
* TLS_AES_256_GCM_SHA384
80-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha256 TLS_AES_256_GCM_SHA384
81-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha384 TLS_AES_256_GCM_SHA384
82-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha512 TLS_AES_256_GCM_SHA384
83-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha256 TLS_AES_256_GCM_SHA384
84-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha384 TLS_AES_256_GCM_SHA384
85-
* @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha512 TLS_AES_256_GCM_SHA384
80+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_rsae_sha256 TLS_AES_256_GCM_SHA384
81+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_rsae_sha384 TLS_AES_256_GCM_SHA384
82+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_rsae_sha512 TLS_AES_256_GCM_SHA384
83+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_pss_sha256 TLS_AES_256_GCM_SHA384
84+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_pss_sha384 TLS_AES_256_GCM_SHA384
85+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.3 rsa_pss_pss_sha512 TLS_AES_256_GCM_SHA384
8686
*
87-
* @run main/othervm TLSTest TLSv1.2 rsa_pkcs1_sha1 TLS_RSA_WITH_AES_128_CBC_SHA
88-
* @run main/othervm TLSTest TLSv1.2 rsa_pkcs1_sha256
87+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pkcs1_sha1 TLS_RSA_WITH_AES_128_CBC_SHA
88+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pkcs1_sha256
8989
* TLS_RSA_WITH_AES_128_CBC_SHA
90-
* @run main/othervm TLSTest TLSv1.2 rsa_pkcs1_sha384
90+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pkcs1_sha384
9191
* TLS_RSA_WITH_AES_256_GCM_SHA384
92-
* @run main/othervm TLSTest TLSv1.2 rsa_pkcs1_sha512
92+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pkcs1_sha512
9393
* TLS_RSA_WITH_AES_128_GCM_SHA256
94-
* @run main/othervm TLSTest TLSv1.2 ec_rsa_pkcs1_sha256
94+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 ec_rsa_pkcs1_sha256
9595
* TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
96-
* @run main/othervm TLSTest TLSv1.2 ecdsa_sha1
96+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 ecdsa_sha1
9797
* TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
98-
* @run main/othervm TLSTest TLSv1.2 ecdsa_secp384r1_sha384
98+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 ecdsa_secp384r1_sha384
9999
* TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
100-
* @run main/othervm TLSTest TLSv1.2 ecdsa_secp521r1_sha512
100+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 ecdsa_secp521r1_sha512
101101
* TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
102-
* @run main/othervm TLSTest TLSv1.2 rsa_pss_rsae_sha256
102+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pss_rsae_sha256
103103
* TLS_RSA_WITH_AES_256_CBC_SHA256
104-
* @run main/othervm TLSTest TLSv1.2 rsa_pss_rsae_sha384
104+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pss_rsae_sha384
105105
* TLS_RSA_WITH_AES_256_CBC_SHA
106-
* @run main/othervm TLSTest TLSv1.2 rsa_pss_rsae_sha512
106+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pss_rsae_sha512
107107
* TLS_RSA_WITH_AES_128_CBC_SHA256
108-
* @run main/othervm TLSTest TLSv1.2 rsa_pss_pss_sha256
108+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pss_pss_sha256
109109
* TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
110-
* @run main/othervm TLSTest TLSv1.2 rsa_pss_pss_sha384
110+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pss_pss_sha384
111111
* TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
112-
* @run main/othervm TLSTest TLSv1.2 rsa_pss_pss_sha512
112+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.2 rsa_pss_pss_sha512
113113
* TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
114114
*
115-
* @run main/othervm TLSTest TLSv1.1 rsa_pkcs1_sha1 TLS_RSA_WITH_AES_128_CBC_SHA
116-
* @run main/othervm TLSTest TLSv1.1 rsa_pkcs1_sha256
115+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.1 rsa_pkcs1_sha1 TLS_RSA_WITH_AES_128_CBC_SHA
116+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.1 rsa_pkcs1_sha256
117117
* TLS_RSA_WITH_AES_256_CBC_SHA
118-
* @run main/othervm TLSTest TLSv1.1 rsa_pkcs1_sha384
118+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.1 rsa_pkcs1_sha384
119119
* TLS_RSA_WITH_AES_128_CBC_SHA
120-
* @run main/othervm TLSTest TLSv1.1 rsa_pkcs1_sha512
120+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.1 rsa_pkcs1_sha512
121121
* TLS_RSA_WITH_AES_256_CBC_SHA
122-
* @run main/othervm TLSTest TLSv1.1 rsa_pss_rsae_sha256
122+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.1 rsa_pss_rsae_sha256
123123
* TLS_RSA_WITH_AES_128_CBC_SHA
124-
* @run main/othervm TLSTest TLSv1.1 rsa_pss_rsae_sha384
124+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.1 rsa_pss_rsae_sha384
125125
* TLS_RSA_WITH_AES_256_CBC_SHA
126-
* @run main/othervm TLSTest TLSv1.1 rsa_pss_rsae_sha512
126+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1.1 rsa_pss_rsae_sha512
127127
* TLS_RSA_WITH_AES_128_CBC_SHA
128128
*
129-
* @run main/othervm TLSTest TLSv1 rsa_pkcs1_sha1 TLS_RSA_WITH_AES_128_CBC_SHA
130-
* @run main/othervm TLSTest TLSv1 rsa_pkcs1_sha256 TLS_RSA_WITH_AES_256_CBC_SHA
131-
* @run main/othervm TLSTest TLSv1 rsa_pkcs1_sha384 TLS_RSA_WITH_AES_128_CBC_SHA
132-
* @run main/othervm TLSTest TLSv1 rsa_pkcs1_sha512 TLS_RSA_WITH_AES_256_CBC_SHA
133-
* @run main/othervm TLSTest TLSv1 rsa_pss_rsae_sha256
129+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1 rsa_pkcs1_sha1 TLS_RSA_WITH_AES_128_CBC_SHA
130+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1 rsa_pkcs1_sha256 TLS_RSA_WITH_AES_256_CBC_SHA
131+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1 rsa_pkcs1_sha384 TLS_RSA_WITH_AES_128_CBC_SHA
132+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1 rsa_pkcs1_sha512 TLS_RSA_WITH_AES_256_CBC_SHA
133+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1 rsa_pss_rsae_sha256
134134
* TLS_RSA_WITH_AES_128_CBC_SHA
135-
* @run main/othervm TLSTest TLSv1 rsa_pss_rsae_sha384
135+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1 rsa_pss_rsae_sha384
136136
* TLS_RSA_WITH_AES_256_CBC_SHA
137-
* @run main/othervm TLSTest TLSv1 rsa_pss_rsae_sha512
137+
* @run main/othervm -Djavax.net.debug=ssl,handshake TLSTest TLSv1 rsa_pss_rsae_sha512
138138
* TLS_RSA_WITH_AES_128_CBC_SHA
139139
*/
140140
public class TLSTest {
@@ -279,7 +279,7 @@ void doClientSide() throws Exception {
279279
keyType.getTrustedCert(), null, null, keyType.getKeyType());
280280
SSLSocketFactory sslsf = ctx.getSocketFactory();
281281
try (SSLSocket sslSocket
282-
= (SSLSocket) sslsf.createSocket("localhost", serverPort)) {
282+
= (SSLSocket) sslsf.createSocket(InetAddress.getLoopbackAddress(), serverPort)) {
283283
// Specify the client cipher suites
284284
sslSocket.setEnabledCipherSuites(new String[]{this.cipher});
285285
sslSocket.setEnabledProtocols(new String[]{this.tlsProtocol});

0 commit comments

Comments
 (0)