author | jjiang |
Fri, 31 Aug 2018 10:32:47 +0800 | |
changeset 51603 | d0b71f6163e1 |
parent 50768 | 68fa3d4026ea |
child 55353 | 946f7f2d321c |
child 58678 | 9cf78a70fa4f |
permissions | -rw-r--r-- |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
1 |
/* |
50768 | 2 |
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
4 |
* |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
8 |
* |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
13 |
* accompanied this code). |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
14 |
* |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
18 |
* |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
21 |
* questions. |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
22 |
*/ |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
23 |
|
42464 | 24 |
// |
25 |
// Please run in othervm mode. SunJSSE does not support dynamic system |
|
26 |
// properties, no way to re-use system properties in samevm/agentvm mode. |
|
27 |
// |
|
42155
c9b28ab5297b
8168969: Merge SSLSocketSample and SSLSocketTemplate
asmotrak
parents:
41595
diff
changeset
|
28 |
|
c9b28ab5297b
8168969: Merge SSLSocketSample and SSLSocketTemplate
asmotrak
parents:
41595
diff
changeset
|
29 |
/* |
c9b28ab5297b
8168969: Merge SSLSocketSample and SSLSocketTemplate
asmotrak
parents:
41595
diff
changeset
|
30 |
* @test |
42464 | 31 |
* @bug 8161106 8170329 |
43335
911fcebb04d2
8173478: SSL related tests failes with message: "java.security.NoSuchAlgorithmException: EC KeyFactory not available"
skovalev
parents:
42920
diff
changeset
|
32 |
* @modules jdk.crypto.ec |
42464 | 33 |
* @summary Improve SSLSocket test template |
42155
c9b28ab5297b
8168969: Merge SSLSocketSample and SSLSocketTemplate
asmotrak
parents:
41595
diff
changeset
|
34 |
* @run main/othervm SSLSocketTemplate |
c9b28ab5297b
8168969: Merge SSLSocketSample and SSLSocketTemplate
asmotrak
parents:
41595
diff
changeset
|
35 |
*/ |
43335
911fcebb04d2
8173478: SSL related tests failes with message: "java.security.NoSuchAlgorithmException: EC KeyFactory not available"
skovalev
parents:
42920
diff
changeset
|
36 |
|
911fcebb04d2
8173478: SSL related tests failes with message: "java.security.NoSuchAlgorithmException: EC KeyFactory not available"
skovalev
parents:
42920
diff
changeset
|
37 |
import java.io.ByteArrayInputStream; |
911fcebb04d2
8173478: SSL related tests failes with message: "java.security.NoSuchAlgorithmException: EC KeyFactory not available"
skovalev
parents:
42920
diff
changeset
|
38 |
import java.io.InputStream; |
911fcebb04d2
8173478: SSL related tests failes with message: "java.security.NoSuchAlgorithmException: EC KeyFactory not available"
skovalev
parents:
42920
diff
changeset
|
39 |
import java.io.IOException; |
911fcebb04d2
8173478: SSL related tests failes with message: "java.security.NoSuchAlgorithmException: EC KeyFactory not available"
skovalev
parents:
42920
diff
changeset
|
40 |
import java.io.OutputStream; |
911fcebb04d2
8173478: SSL related tests failes with message: "java.security.NoSuchAlgorithmException: EC KeyFactory not available"
skovalev
parents:
42920
diff
changeset
|
41 |
import javax.net.ssl.KeyManagerFactory; |
911fcebb04d2
8173478: SSL related tests failes with message: "java.security.NoSuchAlgorithmException: EC KeyFactory not available"
skovalev
parents:
42920
diff
changeset
|
42 |
import javax.net.ssl.SSLContext; |
911fcebb04d2
8173478: SSL related tests failes with message: "java.security.NoSuchAlgorithmException: EC KeyFactory not available"
skovalev
parents:
42920
diff
changeset
|
43 |
import javax.net.ssl.SSLServerSocket; |
911fcebb04d2
8173478: SSL related tests failes with message: "java.security.NoSuchAlgorithmException: EC KeyFactory not available"
skovalev
parents:
42920
diff
changeset
|
44 |
import javax.net.ssl.SSLServerSocketFactory; |
911fcebb04d2
8173478: SSL related tests failes with message: "java.security.NoSuchAlgorithmException: EC KeyFactory not available"
skovalev
parents:
42920
diff
changeset
|
45 |
import javax.net.ssl.SSLSocket; |
911fcebb04d2
8173478: SSL related tests failes with message: "java.security.NoSuchAlgorithmException: EC KeyFactory not available"
skovalev
parents:
42920
diff
changeset
|
46 |
import javax.net.ssl.SSLSocketFactory; |
911fcebb04d2
8173478: SSL related tests failes with message: "java.security.NoSuchAlgorithmException: EC KeyFactory not available"
skovalev
parents:
42920
diff
changeset
|
47 |
import javax.net.ssl.TrustManagerFactory; |
42464 | 48 |
import java.net.InetSocketAddress; |
49 |
import java.net.SocketTimeoutException; |
|
50 |
import java.security.KeyStore; |
|
51 |
import java.security.PrivateKey; |
|
52 |
import java.security.KeyFactory; |
|
53 |
import java.security.cert.Certificate; |
|
54 |
import java.security.cert.CertificateFactory; |
|
43335
911fcebb04d2
8173478: SSL related tests failes with message: "java.security.NoSuchAlgorithmException: EC KeyFactory not available"
skovalev
parents:
42920
diff
changeset
|
55 |
import java.security.spec.PKCS8EncodedKeySpec; |
42464 | 56 |
import java.util.Base64; |
42155
c9b28ab5297b
8168969: Merge SSLSocketSample and SSLSocketTemplate
asmotrak
parents:
41595
diff
changeset
|
57 |
|
42464 | 58 |
import java.util.concurrent.CountDownLatch; |
59 |
import java.util.concurrent.TimeUnit; |
|
60 |
||
61 |
/** |
|
62 |
* Template to help speed your client/server tests. |
|
63 |
* |
|
64 |
* Two examples that use this template: |
|
65 |
* test/sun/security/ssl/ServerHandshaker/AnonCipherWithWantClientAuth.java |
|
66 |
* test/sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java |
|
67 |
*/ |
|
42155
c9b28ab5297b
8168969: Merge SSLSocketSample and SSLSocketTemplate
asmotrak
parents:
41595
diff
changeset
|
68 |
public class SSLSocketTemplate { |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
69 |
|
42464 | 70 |
/* |
71 |
* ================== |
|
72 |
* Run the test case. |
|
73 |
*/ |
|
74 |
public static void main(String[] args) throws Exception { |
|
75 |
(new SSLSocketTemplate()).run(); |
|
76 |
} |
|
77 |
||
78 |
/* |
|
79 |
* Run the test case. |
|
80 |
*/ |
|
81 |
public void run() throws Exception { |
|
82 |
bootup(); |
|
83 |
} |
|
84 |
||
85 |
/* |
|
86 |
* Define the server side application of the test for the specified socket. |
|
87 |
*/ |
|
88 |
protected void runServerApplication(SSLSocket socket) throws Exception { |
|
89 |
// here comes the test logic |
|
90 |
InputStream sslIS = socket.getInputStream(); |
|
91 |
OutputStream sslOS = socket.getOutputStream(); |
|
92 |
||
93 |
sslIS.read(); |
|
94 |
sslOS.write(85); |
|
95 |
sslOS.flush(); |
|
96 |
} |
|
97 |
||
98 |
/* |
|
99 |
* Define the client side application of the test for the specified socket. |
|
100 |
* This method is used if the returned value of |
|
101 |
* isCustomizedClientConnection() is false. |
|
102 |
* |
|
103 |
* @param socket may be null is no client socket is generated. |
|
104 |
* |
|
105 |
* @see #isCustomizedClientConnection() |
|
106 |
*/ |
|
107 |
protected void runClientApplication(SSLSocket socket) throws Exception { |
|
108 |
InputStream sslIS = socket.getInputStream(); |
|
109 |
OutputStream sslOS = socket.getOutputStream(); |
|
110 |
||
111 |
sslOS.write(280); |
|
112 |
sslOS.flush(); |
|
113 |
sslIS.read(); |
|
114 |
} |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
115 |
|
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
116 |
/* |
42464 | 117 |
* Define the client side application of the test for the specified |
118 |
* server port. This method is used if the returned value of |
|
119 |
* isCustomizedClientConnection() is true. |
|
120 |
* |
|
121 |
* Note that the client need to connect to the server port by itself |
|
122 |
* for the actual message exchange. |
|
123 |
* |
|
124 |
* @see #isCustomizedClientConnection() |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
125 |
*/ |
42464 | 126 |
protected void runClientApplication(int serverPort) throws Exception { |
127 |
// blank |
|
128 |
} |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
129 |
|
42464 | 130 |
/* |
131 |
* Create an instance of SSLContext for client use. |
|
132 |
*/ |
|
133 |
protected SSLContext createClientSSLContext() throws Exception { |
|
134 |
return createSSLContext(trustedCertStrs, |
|
135 |
endEntityCertStrs, endEntityPrivateKeys, |
|
50768 | 136 |
endEntityPrivateKeyAlgs, |
42464 | 137 |
endEntityPrivateKeyNames, |
138 |
getClientContextParameters()); |
|
139 |
} |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
140 |
|
42464 | 141 |
/* |
142 |
* Create an instance of SSLContext for server use. |
|
143 |
*/ |
|
144 |
protected SSLContext createServerSSLContext() throws Exception { |
|
145 |
return createSSLContext(trustedCertStrs, |
|
146 |
endEntityCertStrs, endEntityPrivateKeys, |
|
50768 | 147 |
endEntityPrivateKeyAlgs, |
42464 | 148 |
endEntityPrivateKeyNames, |
149 |
getServerContextParameters()); |
|
150 |
} |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
151 |
|
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
152 |
/* |
42464 | 153 |
* The parameters used to configure SSLContext. |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
154 |
*/ |
42464 | 155 |
protected static final class ContextParameters { |
156 |
final String contextProtocol; |
|
157 |
final String tmAlgorithm; |
|
158 |
final String kmAlgorithm; |
|
159 |
||
160 |
ContextParameters(String contextProtocol, |
|
161 |
String tmAlgorithm, String kmAlgorithm) { |
|
162 |
||
163 |
this.contextProtocol = contextProtocol; |
|
164 |
this.tmAlgorithm = tmAlgorithm; |
|
165 |
this.kmAlgorithm = kmAlgorithm; |
|
166 |
} |
|
167 |
} |
|
168 |
||
169 |
/* |
|
170 |
* Get the client side parameters of SSLContext. |
|
171 |
*/ |
|
172 |
protected ContextParameters getClientContextParameters() { |
|
173 |
return new ContextParameters("TLS", "PKIX", "NewSunX509"); |
|
174 |
} |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
175 |
|
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
176 |
/* |
42464 | 177 |
* Get the server side parameters of SSLContext. |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
178 |
*/ |
42464 | 179 |
protected ContextParameters getServerContextParameters() { |
180 |
return new ContextParameters("TLS", "PKIX", "NewSunX509"); |
|
181 |
} |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
182 |
|
42464 | 183 |
/* |
184 |
* Does the client side use customized connection other than |
|
185 |
* explicit Socket.connect(), for example, URL.openConnection()? |
|
186 |
*/ |
|
187 |
protected boolean isCustomizedClientConnection() { |
|
188 |
return false; |
|
189 |
} |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
190 |
|
42464 | 191 |
/* |
42920
781f5e69910b
8168935: sun/security/ssl/SSLContextImpl/TrustTrustedCert.java failed Intermittently
mli
parents:
42464
diff
changeset
|
192 |
* Configure the server side socket. |
781f5e69910b
8168935: sun/security/ssl/SSLContextImpl/TrustTrustedCert.java failed Intermittently
mli
parents:
42464
diff
changeset
|
193 |
*/ |
781f5e69910b
8168935: sun/security/ssl/SSLContextImpl/TrustTrustedCert.java failed Intermittently
mli
parents:
42464
diff
changeset
|
194 |
protected void configureServerSocket(SSLServerSocket socket) { |
781f5e69910b
8168935: sun/security/ssl/SSLContextImpl/TrustTrustedCert.java failed Intermittently
mli
parents:
42464
diff
changeset
|
195 |
|
781f5e69910b
8168935: sun/security/ssl/SSLContextImpl/TrustTrustedCert.java failed Intermittently
mli
parents:
42464
diff
changeset
|
196 |
} |
781f5e69910b
8168935: sun/security/ssl/SSLContextImpl/TrustTrustedCert.java failed Intermittently
mli
parents:
42464
diff
changeset
|
197 |
|
781f5e69910b
8168935: sun/security/ssl/SSLContextImpl/TrustTrustedCert.java failed Intermittently
mli
parents:
42464
diff
changeset
|
198 |
/* |
42464 | 199 |
* ============================================= |
200 |
* Define the client and server side operations. |
|
201 |
* |
|
202 |
* If the client or server is doing some kind of object creation |
|
203 |
* that the other side depends on, and that thread prematurely |
|
204 |
* exits, you may experience a hang. The test harness will |
|
205 |
* terminate all hung threads after its timeout has expired, |
|
206 |
* currently 3 minutes by default, but you might try to be |
|
207 |
* smart about it.... |
|
208 |
*/ |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
209 |
|
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
210 |
/* |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
211 |
* Is the server ready to serve? |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
212 |
*/ |
42464 | 213 |
private final CountDownLatch serverCondition = new CountDownLatch(1); |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
214 |
|
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
215 |
/* |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
216 |
* Is the client ready to handshake? |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
217 |
*/ |
42464 | 218 |
private final CountDownLatch clientCondition = new CountDownLatch(1); |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
219 |
|
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
220 |
/* |
42464 | 221 |
* What's the server port? Use any free port by default |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
222 |
*/ |
51603
d0b71f6163e1
8209362: sun/security/ssl/SSLSocketImpl/ReuseAddr.java failed due to "BindException: Address already in use (Bind failed)"
jjiang
parents:
50768
diff
changeset
|
223 |
protected volatile int serverPort = 0; |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
224 |
|
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
225 |
/* |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
226 |
* Define the server side of the test. |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
227 |
*/ |
51603
d0b71f6163e1
8209362: sun/security/ssl/SSLSocketImpl/ReuseAddr.java failed due to "BindException: Address already in use (Bind failed)"
jjiang
parents:
50768
diff
changeset
|
228 |
protected void doServerSide() throws Exception { |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
229 |
// kick start the server side service |
42464 | 230 |
SSLContext context = createServerSSLContext(); |
231 |
SSLServerSocketFactory sslssf = context.getServerSocketFactory(); |
|
232 |
SSLServerSocket sslServerSocket = |
|
233 |
(SSLServerSocket)sslssf.createServerSocket(serverPort); |
|
42920
781f5e69910b
8168935: sun/security/ssl/SSLContextImpl/TrustTrustedCert.java failed Intermittently
mli
parents:
42464
diff
changeset
|
234 |
configureServerSocket(sslServerSocket); |
42464 | 235 |
serverPort = sslServerSocket.getLocalPort(); |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
236 |
|
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
237 |
// Signal the client, the server is ready to accept connection. |
42464 | 238 |
serverCondition.countDown(); |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
239 |
|
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
240 |
// Try to accept a connection in 30 seconds. |
42464 | 241 |
SSLSocket sslSocket; |
242 |
try { |
|
243 |
sslServerSocket.setSoTimeout(30000); |
|
244 |
sslSocket = (SSLSocket)sslServerSocket.accept(); |
|
245 |
} catch (SocketTimeoutException ste) { |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
246 |
// Ignore the test case if no connection within 30 seconds. |
42464 | 247 |
System.out.println( |
248 |
"No incoming client connection in 30 seconds. " + |
|
249 |
"Ignore in server side."); |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
250 |
return; |
42464 | 251 |
} finally { |
252 |
sslServerSocket.close(); |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
253 |
} |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
254 |
|
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
255 |
// handle the connection |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
256 |
try { |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
257 |
// Is it the expected client connection? |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
258 |
// |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
259 |
// Naughty test cases or third party routines may try to |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
260 |
// connection to this server port unintentionally. In |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
261 |
// order to mitigate the impact of unexpected client |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
262 |
// connections and avoid intermittent failure, it should |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
263 |
// be checked that the accepted connection is really linked |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
264 |
// to the expected client. |
42464 | 265 |
boolean clientIsReady = |
266 |
clientCondition.await(30L, TimeUnit.SECONDS); |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
267 |
|
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
268 |
if (clientIsReady) { |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
269 |
// Run the application in server side. |
42464 | 270 |
runServerApplication(sslSocket); |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
271 |
} else { // Otherwise, ignore |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
272 |
// We don't actually care about plain socket connections |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
273 |
// for TLS communication testing generally. Just ignore |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
274 |
// the test if the accepted connection is not linked to |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
275 |
// the expected client or the client connection timeout |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
276 |
// in 30 seconds. |
42464 | 277 |
System.out.println( |
278 |
"The client is not the expected one or timeout. " + |
|
279 |
"Ignore in server side."); |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
280 |
} |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
281 |
} finally { |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
282 |
sslSocket.close(); |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
283 |
} |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
284 |
} |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
285 |
|
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
286 |
/* |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
287 |
* Define the client side of the test. |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
288 |
*/ |
51603
d0b71f6163e1
8209362: sun/security/ssl/SSLSocketImpl/ReuseAddr.java failed due to "BindException: Address already in use (Bind failed)"
jjiang
parents:
50768
diff
changeset
|
289 |
protected void doClientSide() throws Exception { |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
290 |
|
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
291 |
// Wait for server to get started. |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
292 |
// |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
293 |
// The server side takes care of the issue if the server cannot |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
294 |
// get started in 90 seconds. The client side would just ignore |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
295 |
// the test case if the serer is not ready. |
42464 | 296 |
boolean serverIsReady = |
297 |
serverCondition.await(90L, TimeUnit.SECONDS); |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
298 |
if (!serverIsReady) { |
42464 | 299 |
System.out.println( |
300 |
"The server is not ready yet in 90 seconds. " + |
|
301 |
"Ignore in client side."); |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
302 |
return; |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
303 |
} |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
304 |
|
42464 | 305 |
if (isCustomizedClientConnection()) { |
306 |
// Signal the server, the client is ready to communicate. |
|
307 |
clientCondition.countDown(); |
|
308 |
||
309 |
// Run the application in client side. |
|
310 |
runClientApplication(serverPort); |
|
311 |
||
312 |
return; |
|
313 |
} |
|
314 |
||
315 |
SSLContext context = createClientSSLContext(); |
|
316 |
SSLSocketFactory sslsf = context.getSocketFactory(); |
|
317 |
||
318 |
try (SSLSocket sslSocket = (SSLSocket)sslsf.createSocket()) { |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
319 |
try { |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
320 |
sslSocket.connect( |
42464 | 321 |
new InetSocketAddress("localhost", serverPort), 15000); |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
322 |
} catch (IOException ioe) { |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
323 |
// The server side may be impacted by naughty test cases or |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
324 |
// third party routines, and cannot accept connections. |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
325 |
// |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
326 |
// Just ignore the test if the connection cannot be |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
327 |
// established. |
42464 | 328 |
System.out.println( |
329 |
"Cannot make a connection in 15 seconds. " + |
|
330 |
"Ignore in client side."); |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
331 |
return; |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
332 |
} |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
333 |
|
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
334 |
// OK, here the client and server get connected. |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
335 |
|
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
336 |
// Signal the server, the client is ready to communicate. |
42464 | 337 |
clientCondition.countDown(); |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
338 |
|
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
339 |
// There is still a chance in theory that the server thread may |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
340 |
// wait client-ready timeout and then quit. The chance should |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
341 |
// be really rare so we don't consider it until it becomes a |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
342 |
// real problem. |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
343 |
|
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
344 |
// Run the application in client side. |
42464 | 345 |
runClientApplication(sslSocket); |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
346 |
} |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
347 |
} |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
348 |
|
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
349 |
/* |
42464 | 350 |
* ============================================= |
351 |
* Stuffs to customize the SSLContext instances. |
|
352 |
*/ |
|
353 |
||
354 |
/* |
|
355 |
* ======================================= |
|
356 |
* Certificates and keys used in the test. |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
357 |
*/ |
42464 | 358 |
// Trusted certificates. |
359 |
private final static String[] trustedCertStrs = { |
|
360 |
// SHA256withECDSA, curve prime256v1 |
|
361 |
// Validity |
|
50768 | 362 |
// Not Before: May 22 07:18:16 2018 GMT |
363 |
// Not After : May 17 07:18:16 2038 GMT |
|
42464 | 364 |
// Subject Key Identifier: |
50768 | 365 |
// 60:CF:BD:73:FF:FA:1A:30:D2:A4:EC:D3:49:71:46:EF:1A:35:A0:86 |
42464 | 366 |
"-----BEGIN CERTIFICATE-----\n" + |
50768 | 367 |
"MIIBvjCCAWOgAwIBAgIJAIvFG6GbTroCMAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" + |
368 |
"AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + |
|
369 |
"ZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMDsxCzAJBgNVBAYTAlVT\n" + |
|
370 |
"MQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZjZTBZ\n" + |
|
371 |
"MBMGByqGSM49AgEGCCqGSM49AwEHA0IABBz1WeVb6gM2mh85z3QlvaB/l11b5h0v\n" + |
|
372 |
"LIzmkC3DKlVukZT+ltH2Eq1oEkpXuf7QmbM0ibrUgtjsWH3mULfmcWmjUDBOMB0G\n" + |
|
373 |
"A1UdDgQWBBRgz71z//oaMNKk7NNJcUbvGjWghjAfBgNVHSMEGDAWgBRgz71z//oa\n" + |
|
374 |
"MNKk7NNJcUbvGjWghjAMBgNVHRMEBTADAQH/MAoGCCqGSM49BAMCA0kAMEYCIQCG\n" + |
|
375 |
"6wluh1r2/T6L31mZXRKf9JxeSf9pIzoLj+8xQeUChQIhAJ09wAi1kV8yePLh2FD9\n" + |
|
376 |
"2YEHlSQUAbwwqCDEVB5KxaqP\n" + |
|
42464 | 377 |
"-----END CERTIFICATE-----", |
50768 | 378 |
// -----BEGIN PRIVATE KEY----- |
379 |
// MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg/HcHdoLJCdq3haVd |
|
380 |
// XZTSKP00YzM3xX97l98vGL/RI1KhRANCAAQc9VnlW+oDNpofOc90Jb2gf5ddW+Yd |
|
381 |
// LyyM5pAtwypVbpGU/pbR9hKtaBJKV7n+0JmzNIm61ILY7Fh95lC35nFp |
|
382 |
// -----END PRIVATE KEY----- |
|
42464 | 383 |
|
384 |
// SHA256withRSA, 2048 bits |
|
385 |
// Validity |
|
50768 | 386 |
// Not Before: May 22 07:18:16 2018 GMT |
387 |
// Not After : May 17 07:18:16 2038 GMT |
|
42464 | 388 |
// Subject Key Identifier: |
50768 | 389 |
// 0D:DD:93:C9:FE:4B:BD:35:B7:E8:99:78:90:FB:DB:5A:3D:DB:15:4C |
42464 | 390 |
"-----BEGIN CERTIFICATE-----\n" + |
50768 | 391 |
"MIIDSTCCAjGgAwIBAgIJAI4ZF3iy8zG+MA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" + |
392 |
"BAYTAlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + |
|
393 |
"aXZjZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMDsxCzAJBgNVBAYT\n" + |
|
394 |
"AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + |
|
395 |
"ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALpMcY7aWieXDEM1/YJf\n" + |
|
396 |
"JW27b4nRIFZyEYhEloyGsKTuQiiQjc8cqRZFNXe2vwziDB4IyTEl0Hjl5QF6ZaQE\n" + |
|
397 |
"huPzzwvQm1pv64KrRXrmj3FisQK8B5OWLty9xp6xDqsaMRoyObLK+oIb20T5fSlE\n" + |
|
398 |
"evmo1vYjnh8CX0Yzx5Gr5ye6YSEHQvYOWEws8ad17OlyToR2KMeC8w4qo6rs59pW\n" + |
|
399 |
"g7Mxn9vo22ImDzrtAbTbXbCias3xlE0Bp0h5luyf+5U4UgksoL9B9r2oP4GrLNEV\n" + |
|
400 |
"oJk57t8lwaR0upiv3CnS8LcJELpegZub5ggqLY8ZPYFQPjlK6IzLOm6rXPgZiZ3m\n" + |
|
401 |
"RL0CAwEAAaNQME4wHQYDVR0OBBYEFA3dk8n+S701t+iZeJD721o92xVMMB8GA1Ud\n" + |
|
402 |
"IwQYMBaAFA3dk8n+S701t+iZeJD721o92xVMMAwGA1UdEwQFMAMBAf8wDQYJKoZI\n" + |
|
403 |
"hvcNAQELBQADggEBAJTRC3rKUUhVH07/1+stUungSYgpM08dY4utJq0BDk36BbmO\n" + |
|
404 |
"0AnLDMbkwFdHEoqF6hQIfpm7SQTmXk0Fss6Eejm8ynYr6+EXiRAsaXOGOBCzF918\n" + |
|
405 |
"/RuKOzqABfgSU4UBKECLM5bMfQTL60qx+HdbdVIpnikHZOFfmjCDVxoHsGyXc1LW\n" + |
|
406 |
"Jhkht8IGOgc4PMGvyzTtRFjz01kvrVQZ75aN2E0GQv6dCxaEY0i3ypSzjUWAKqDh\n" + |
|
407 |
"3e2OLwUSvumcdaxyCdZAOUsN6pDBQ+8VRG7KxnlRlY1SMEk46QgQYLbPDe/+W/yH\n" + |
|
408 |
"ca4PejicPeh+9xRAwoTpiE2gulfT7Lm+fVM7Ruc=\n" + |
|
42464 | 409 |
"-----END CERTIFICATE-----", |
50768 | 410 |
// -----BEGIN PRIVATE KEY----- |
411 |
// MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC6THGO2lonlwxD |
|
412 |
// Nf2CXyVtu2+J0SBWchGIRJaMhrCk7kIokI3PHKkWRTV3tr8M4gweCMkxJdB45eUB |
|
413 |
// emWkBIbj888L0Jtab+uCq0V65o9xYrECvAeTli7cvcaesQ6rGjEaMjmyyvqCG9tE |
|
414 |
// +X0pRHr5qNb2I54fAl9GM8eRq+cnumEhB0L2DlhMLPGndezpck6EdijHgvMOKqOq |
|
415 |
// 7OfaVoOzMZ/b6NtiJg867QG0212womrN8ZRNAadIeZbsn/uVOFIJLKC/Qfa9qD+B |
|
416 |
// qyzRFaCZOe7fJcGkdLqYr9wp0vC3CRC6XoGbm+YIKi2PGT2BUD45SuiMyzpuq1z4 |
|
417 |
// GYmd5kS9AgMBAAECggEAFHSoU2MuWwJ+2jJnb5U66t2V1bAcuOE1g5zkWvG/G5z9 |
|
418 |
// rq6Qo5kmB8f5ovdx6tw3MGUOklLwnRXBG3RxDJ1iokz3AvkY1clMNsDPlDsUrQKF |
|
419 |
// JSO4QUBQTPSZhnsyfR8XHSU+qJ8Y+ohMfzpVv95BEoCzebtXdVgxVegBlcEmVHo2 |
|
420 |
// kMmkRN+bYNsr8eb2r+b0EpyumS39ZgKYh09+cFb78y3T6IFMGcVJTP6nlGBFkmA/ |
|
421 |
// 25pYeCF2tSki08qtMJZQAvKfw0Kviibk7ZxRbJqmc7B1yfnOEHP6ftjuvKl2+RP/ |
|
422 |
// +5P5f8CfIP6gtA0LwSzAqQX/hfIKrGV5j0pCqrD0kQKBgQDeNR6Xi4sXVq79lihO |
|
423 |
// a1bSeV7r8yoQrS8x951uO+ox+UIZ1MsAULadl7zB/P0er92p198I9M/0Jth3KBuS |
|
424 |
// zj45mucvpiiGvmQlMKMEfNq4nN7WHOu55kufPswQB2mR4J3xmwI+4fM/nl1zc82h |
|
425 |
// De8JSazRldJXNhfx0RGFPmgzbwKBgQDWoVXrXLbCAn41oVnWB8vwY9wjt92ztDqJ |
|
426 |
// HMFA/SUohjePep9UDq6ooHyAf/Lz6oE5NgeVpPfTDkgvrCFVKnaWdwALbYoKXT2W |
|
427 |
// 9FlyJox6eQzrtHAacj3HJooXWuXlphKSizntfxj3LtMR9BmrmRJOfK+SxNOVJzW2 |
|
428 |
// +MowT20EkwKBgHmpB8jdZBgxI7o//m2BI5Y1UZ1KE5vx1kc7VXzHXSBjYqeV9FeF |
|
429 |
// 2ZZLP9POWh/1Fh4pzTmwIDODGT2UPhSQy0zq3O0fwkyT7WzXRknsuiwd53u/dejg |
|
430 |
// iEL2NPAJvulZ2+AuiHo5Z99LK8tMeidV46xoJDDUIMgTG+UQHNGhK5gNAoGAZn/S |
|
431 |
// Cn7SgMC0CWSvBHnguULXZO9wH1wZAFYNLL44OqwuaIUFBh2k578M9kkke7woTmwx |
|
432 |
// HxQTjmWpr6qimIuY6q6WBN8hJ2Xz/d1fwhYKzIp20zHuv5KDUlJjbFfqpsuy3u1C |
|
433 |
// kts5zwI7pr1ObRbDGVyOdKcu7HI3QtR5qqyjwaUCgYABo7Wq6oHva/9V34+G3Goh |
|
434 |
// 63bYGUnRw2l5BD11yhQv8XzGGZFqZVincD8gltNThB0Dc/BI+qu3ky4YdgdZJZ7K |
|
435 |
// z51GQGtaHEbrHS5caV79yQ8QGY5mUVH3E+VXSxuIqb6pZq2DH4sTAEFHyncddmOH |
|
436 |
// zoXBInYwRG9KE/Bw5elhUw== |
|
437 |
// -----END PRIVATE KEY----- |
|
42464 | 438 |
|
439 |
// SHA256withDSA, 2048 bits |
|
440 |
// Validity |
|
50768 | 441 |
// Not Before: May 22 07:18:18 2018 GMT |
442 |
// Not After : May 17 07:18:18 2038 GMT |
|
42464 | 443 |
// Subject Key Identifier: |
50768 | 444 |
// 76:66:9E:F7:3B:DD:45:E5:3B:D9:72:3C:3F:F0:54:39:86:31:26:53 |
42464 | 445 |
"-----BEGIN CERTIFICATE-----\n" + |
50768 | 446 |
"MIIErjCCBFSgAwIBAgIJAOktYLNCbr02MAsGCWCGSAFlAwQDAjA7MQswCQYDVQQG\n" + |
447 |
"EwJVUzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2\n" + |
|
448 |
"Y2UwHhcNMTgwNTIyMDcxODE4WhcNMzgwNTE3MDcxODE4WjA7MQswCQYDVQQGEwJV\n" + |
|
449 |
"UzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2Y2Uw\n" + |
|
450 |
"ggNHMIICOQYHKoZIzjgEATCCAiwCggEBAO5GyPhSm0ze3LSu+gicdULLj05iOfTL\n" + |
|
451 |
"UvZQ29sYz41zmqrLBQbdKiHqgJu2Re9sgTb5suLNjF047TOLPnU3jhPtWm2X8Xzi\n" + |
|
452 |
"VGIcHym/Q/MeZxStt/88seqroI3WOKzIML2GcrishT+lcGrtH36Tf1+ue2Snn3PS\n" + |
|
453 |
"WyxygNqPjllP5uUjYmFLvAf4QLMldkd/D2VxcwsHjB8y5iUZsXezc/LEhRZS/02m\n" + |
|
454 |
"ivqlRw3AMkq/OVe/ZtxFWsP0nsfxEGdZuaUFpppGfixxFvymrB3+J51cTt+pZBDq\n" + |
|
455 |
"D2y0DYfc+88iCs4jwHTfcDIpLb538HBjBj2rEgtQESQmB0ooD/+wsPsCIQC1bYch\n" + |
|
456 |
"gElNtDYL3FgpLgNSUYp7gIWv9ehaC7LO2z7biQKCAQBitvFOnDkUja8NAF7lDpOV\n" + |
|
457 |
"b5ipQ8SicBLW3kQamxhyuyxgZyy/PojZ/oPorkqW/T/A0rhnG6MssEpAtdiwVB+c\n" + |
|
458 |
"rBYGo3bcwmExJhdOJ6dYuKFppPWhCwKMHs9npK+lqBMl8l5j58xlcFeC7ZfGf8GY\n" + |
|
459 |
"GkhFW0c44vEQhMMbac6ZTTP4mw+1t7xJfmDMlLEyIpTXaAAk8uoVLWzQWnR40sHi\n" + |
|
460 |
"ybvS0u3JxQkb7/y8tOOZu8qlz/YOS7lQ6UxUGX27Ce1E0+agfPphetoRAlS1cezq\n" + |
|
461 |
"Wa7r64Ga0nkj1kwkcRqjgTiJx0NwnUXr78VAXFhVF95+O3lfqhvdtEGtkhDGPg7N\n" + |
|
462 |
"A4IBBgACggEBAMmSHQK0w2i+iqUjOPzn0yNEZrzepLlLeQ1tqtn0xnlv5vBAeefD\n" + |
|
463 |
"Pm9dd3tZOjufVWP7hhEz8xPobb1CS4e3vuQiv5UBfhdPL3f3l9T7JMAKPH6C9Vve\n" + |
|
464 |
"OQXE5eGqbjsySbcmseHoYUt1WCSnSda1opX8zchX04e7DhGfE2/L9flpYEoSt8lI\n" + |
|
465 |
"vMNjgOwvKdW3yvPt1/eBBHYNFG5gWPv/Q5KoyCtHS03uqGm4rNc/wZTIEEfd66C+\n" + |
|
466 |
"QRaUltjOaHmtwOdDHaNqwhYZSVOip+Mo+TfyzHFREcdHLapo7ZXqbdYkRGxRR3d+\n" + |
|
467 |
"3DfHaraJO0OKoYlPkr3JMvM/MSGR9AnZOcejUDBOMB0GA1UdDgQWBBR2Zp73O91F\n" + |
|
468 |
"5TvZcjw/8FQ5hjEmUzAfBgNVHSMEGDAWgBR2Zp73O91F5TvZcjw/8FQ5hjEmUzAM\n" + |
|
469 |
"BgNVHRMEBTADAQH/MAsGCWCGSAFlAwQDAgNHADBEAiBzriYE41M2y9Hy5ppkL0Qn\n" + |
|
470 |
"dIlNc8JhXT/PHW7GDtViagIgMko8Qoj9gDGPK3+O9E8DC3wGiiF9CObM4LN387ok\n" + |
|
471 |
"J+g=\n" + |
|
42464 | 472 |
"-----END CERTIFICATE-----" |
50768 | 473 |
// -----BEGIN PRIVATE KEY----- |
474 |
// MIICZQIBADCCAjkGByqGSM44BAEwggIsAoIBAQDuRsj4UptM3ty0rvoInHVCy49O |
|
475 |
// Yjn0y1L2UNvbGM+Nc5qqywUG3Soh6oCbtkXvbIE2+bLizYxdOO0ziz51N44T7Vpt |
|
476 |
// l/F84lRiHB8pv0PzHmcUrbf/PLHqq6CN1jisyDC9hnK4rIU/pXBq7R9+k39frntk |
|
477 |
// p59z0lsscoDaj45ZT+blI2JhS7wH+ECzJXZHfw9lcXMLB4wfMuYlGbF3s3PyxIUW |
|
478 |
// Uv9Npor6pUcNwDJKvzlXv2bcRVrD9J7H8RBnWbmlBaaaRn4scRb8pqwd/iedXE7f |
|
479 |
// qWQQ6g9stA2H3PvPIgrOI8B033AyKS2+d/BwYwY9qxILUBEkJgdKKA//sLD7AiEA |
|
480 |
// tW2HIYBJTbQ2C9xYKS4DUlGKe4CFr/XoWguyzts+24kCggEAYrbxTpw5FI2vDQBe |
|
481 |
// 5Q6TlW+YqUPEonAS1t5EGpsYcrssYGcsvz6I2f6D6K5Klv0/wNK4ZxujLLBKQLXY |
|
482 |
// sFQfnKwWBqN23MJhMSYXTienWLihaaT1oQsCjB7PZ6SvpagTJfJeY+fMZXBXgu2X |
|
483 |
// xn/BmBpIRVtHOOLxEITDG2nOmU0z+JsPtbe8SX5gzJSxMiKU12gAJPLqFS1s0Fp0 |
|
484 |
// eNLB4sm70tLtycUJG+/8vLTjmbvKpc/2Dku5UOlMVBl9uwntRNPmoHz6YXraEQJU |
|
485 |
// tXHs6lmu6+uBmtJ5I9ZMJHEao4E4icdDcJ1F6+/FQFxYVRfefjt5X6ob3bRBrZIQ |
|
486 |
// xj4OzQQjAiEAsceWOM8do4etxp2zgnoNXV8PUUyqWhz1+0srcKV7FR4= |
|
487 |
// -----END PRIVATE KEY----- |
|
42464 | 488 |
}; |
489 |
||
490 |
// End entity certificate. |
|
491 |
private final static String[] endEntityCertStrs = { |
|
492 |
// SHA256withECDSA, curve prime256v1 |
|
493 |
// Validity |
|
50768 | 494 |
// Not Before: May 22 07:18:16 2018 GMT |
495 |
// Not After : May 17 07:18:16 2038 GMT |
|
42464 | 496 |
// Authority Key Identifier: |
50768 | 497 |
// 60:CF:BD:73:FF:FA:1A:30:D2:A4:EC:D3:49:71:46:EF:1A:35:A0:86 |
42464 | 498 |
"-----BEGIN CERTIFICATE-----\n" + |
50768 | 499 |
"MIIBqjCCAVCgAwIBAgIJAPLY8qZjgNRAMAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" + |
500 |
"AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + |
|
501 |
"ZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMFUxCzAJBgNVBAYTAlVT\n" + |
|
42464 | 502 |
"MQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZjZTEY\n" + |
503 |
"MBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcD\n" + |
|
50768 | 504 |
"QgAEb+9n05qfXnfHUb0xtQJNS4JeSi6IjOfW5NqchvKnfJey9VkJzR7QHLuOESdf\n" + |
505 |
"xlR7q8YIWgih3iWLGfB+wxHiOqMjMCEwHwYDVR0jBBgwFoAUYM+9c//6GjDSpOzT\n" + |
|
506 |
"SXFG7xo1oIYwCgYIKoZIzj0EAwIDSAAwRQIgWpRegWXMheiD3qFdd8kMdrkLxRbq\n" + |
|
507 |
"1zj8nQMEwFTUjjQCIQDRIrAjZX+YXHN9b0SoWWLPUq0HmiFIi8RwMnO//wJIGQ==\n" + |
|
42464 | 508 |
"-----END CERTIFICATE-----", |
509 |
||
510 |
// SHA256withRSA, 2048 bits |
|
511 |
// Validity |
|
50768 | 512 |
// Not Before: May 22 07:18:16 2018 GMT |
513 |
// Not After : May 17 07:18:16 2038 GMT |
|
42464 | 514 |
// Authority Key Identifier: |
50768 | 515 |
// 0D:DD:93:C9:FE:4B:BD:35:B7:E8:99:78:90:FB:DB:5A:3D:DB:15:4C |
42464 | 516 |
"-----BEGIN CERTIFICATE-----\n" + |
50768 | 517 |
"MIIDNjCCAh6gAwIBAgIJAO2+yPcFryUTMA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" + |
518 |
"BAYTAlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + |
|
519 |
"aXZjZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMFUxCzAJBgNVBAYT\n" + |
|
42464 | 520 |
"AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + |
521 |
"ZTEYMBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOC\n" + |
|
50768 | 522 |
"AQ8AMIIBCgKCAQEAszfBobWfZIp8AgC6PiWDDavP65mSvgCXUGxACbxVNAfkLhNR\n" + |
523 |
"QOsHriRB3X1Q3nvO9PetC6wKlvE9jlnDDj7D+1j1r1CHO7ms1fq8rfcQYdkanDtu\n" + |
|
524 |
"4AlHo8v+SSWX16MIXFRYDj2VVHmyPtgbltcg4zGAuwT746FdLI94uXjJjq1IOr/v\n" + |
|
525 |
"0VIlwE5ORWH5Xc+5Tj+oFWK0E4a4GHDgtKKhn2m72hN56/GkPKGkguP5NRS1qYYV\n" + |
|
526 |
"/EFkdyQMOV8J1M7HaicSft4OL6eKjTrgo93+kHk+tv0Dc6cpVBnalX3TorG8QI6B\n" + |
|
527 |
"cHj1XQd78oAlAC+/jF4pc0mwi0un49kdK9gRfQIDAQABoyMwITAfBgNVHSMEGDAW\n" + |
|
528 |
"gBQN3ZPJ/ku9NbfomXiQ+9taPdsVTDANBgkqhkiG9w0BAQsFAAOCAQEApXS0nKwm\n" + |
|
529 |
"Kp8gpmO2yG1rpd1+2wBABiMU4JZaTqmma24DQ3RzyS+V2TeRb29dl5oTUEm98uc0\n" + |
|
530 |
"GPZvhK8z5RFr4YE17dc04nI/VaNDCw4y1NALXGs+AHkjoPjLyGbWpi1S+gfq2sNB\n" + |
|
531 |
"Ekkjp6COb/cb9yiFXOGVls7UOIjnVZVd0r7KaPFjZhYh82/f4PA/A1SnIKd1+nfH\n" + |
|
532 |
"2yk7mSJNC7Z3qIVDL8MM/jBVwiC3uNe5GPB2uwhd7k5LGAVN3j4HQQGB0Sz+VC1h\n" + |
|
533 |
"92oi6xDa+YBva2fvHuCd8P50DDjxmp9CemC7rnZ5j8egj88w14X44Xjb/Fd/ApG9\n" + |
|
534 |
"e57NnbT7KM+Grw==\n" + |
|
535 |
"-----END CERTIFICATE-----", |
|
536 |
||
537 |
// SHA256withRSA, curv prime256v1 |
|
538 |
// Validity |
|
539 |
// Not Before: May 22 07:18:16 2018 GMT |
|
540 |
// Not After : May 21 07:18:16 2028 GMT |
|
541 |
// Authority Key Identifier: |
|
542 |
// 0D:DD:93:C9:FE:4B:BD:35:B7:E8:99:78:90:FB:DB:5A:3D:DB:15:4C |
|
543 |
"-----BEGIN CERTIFICATE-----\n" + |
|
544 |
"MIICazCCAVOgAwIBAgIJAO2+yPcFryUUMA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" + |
|
545 |
"BAYTAlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + |
|
546 |
"aXZjZTAeFw0xODA1MjIwNzE4MTZaFw0yODA1MjEwNzE4MTZaMFUxCzAJBgNVBAYT\n" + |
|
547 |
"AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + |
|
548 |
"ZTEYMBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MFkwEwYHKoZIzj0CAQYIKoZIzj0D\n" + |
|
549 |
"AQcDQgAE59MERNTlVZ1eeps8Z3Oue5ZkgQdPtD+WIE6tj3PbIKpxGPDxvfNP959A\n" + |
|
550 |
"yQjEK/ehWQVrCMmNoEkIzY+IIBgB06MjMCEwHwYDVR0jBBgwFoAUDd2Tyf5LvTW3\n" + |
|
551 |
"6Jl4kPvbWj3bFUwwDQYJKoZIhvcNAQELBQADggEBAFOTVEqs70ykhZiIdrEsF1Ra\n" + |
|
552 |
"I3B2rLvwXZk52uSltk2/bzVvewA577ZCoxQ1pL7ynkisPfBN1uVYtHjM1VA3RC+4\n" + |
|
553 |
"+TAK78dnI7otYjWoHp5rvs4l6c/IbOspS290IlNuDUxMErEm5wxIwj+Aukx/1y68\n" + |
|
554 |
"hOyCvHBLMY2c1LskH1MMBbDuS1aI+lnGpToi+MoYObxGcV458vxuT8+wwV8Fkpvd\n" + |
|
555 |
"ll8IIFmeNPRv+1E+lXbES6CSNCVaZ/lFhPgdgYKleN7sfspiz50DG4dqafuEAaX5\n" + |
|
556 |
"xaK1NWXJxTRz0ROH/IUziyuDW6jphrlgit4+3NCzp6vP9hAJQ8Vhcj0n15BKHIQ=\n" + |
|
42464 | 557 |
"-----END CERTIFICATE-----", |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
558 |
|
42464 | 559 |
// SHA256withDSA, 2048 bits |
560 |
// Validity |
|
50768 | 561 |
// Not Before: May 22 07:18:20 2018 GMT |
562 |
// Not After : May 17 07:18:20 2038 GMT |
|
42464 | 563 |
// Authority Key Identifier: |
50768 | 564 |
// 76:66:9E:F7:3B:DD:45:E5:3B:D9:72:3C:3F:F0:54:39:86:31:26:53 |
42464 | 565 |
"-----BEGIN CERTIFICATE-----\n" + |
50768 | 566 |
"MIIEnDCCBEGgAwIBAgIJAP/jh1qVhNVjMAsGCWCGSAFlAwQDAjA7MQswCQYDVQQG\n" + |
567 |
"EwJVUzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2\n" + |
|
568 |
"Y2UwHhcNMTgwNTIyMDcxODIwWhcNMzgwNTE3MDcxODIwWjBVMQswCQYDVQQGEwJV\n" + |
|
42464 | 569 |
"UzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2Y2Ux\n" + |
50768 | 570 |
"GDAWBgNVBAMMD1JlZ3Jlc3Npb24gVGVzdDCCA0cwggI6BgcqhkjOOAQBMIICLQKC\n" + |
571 |
"AQEAmlavgoJrMcjqWRVcDE2dmWAPREgnzQvneEDef68cprDzjSwvOs5QeFyx75ib\n" + |
|
572 |
"ado1e6jO/rW1prCGWHDD1oA/Tn4Pk3vu0nUxzvl1qATc+aJbpUU5Op0bvp6LbCsQ\n" + |
|
573 |
"QslV9FeRh7Eb7bP6gpc/kHCBzEgC1VCK7prccXWy+t6SMOHbND3h+UbckfSaUuaV\n" + |
|
574 |
"sVJNTD1D6GElfRj4Nmz1BGPfSYvKorwNZEU3gXwFgtDoAcGx7tcyClLpDHfqRfw/\n" + |
|
575 |
"7yiqLyeiP7D4hl5lMNouJWDlAdMFp0FMgS3s9VDFinIcr6VtBWMTG7+4+czHAB+3\n" + |
|
576 |
"fvrwlqNzhBn3uFHrekN/w8fNxwIhAJo7Sae1za7IMW0Q6hE5B4b+s2B/FaKPoA4E\n" + |
|
577 |
"jtZu13B9AoIBAQCOZqLMKfvqZWUgT0PQ3QjR7dAFdd06I9Y3+TOQzZk1+j+vw/6E\n" + |
|
578 |
"X4vFItX4gihb/u5Q9CdmpwhVGi7bvo+7+/IKeTgoQ6f5+PSug7SrWWUQ5sPwaZui\n" + |
|
579 |
"zXZJ5nTeZDucFc2yFx0wgnjbPwiUxZklOT7xGiOMtzOTa2koCz5KuIBL+/wPKKxm\n" + |
|
580 |
"ypo9VoY9xfbdU6LMXZv/lpD5XTM9rYHr/vUTNkukvV6Hpm0YMEWhVZKUJiqCqTqG\n" + |
|
581 |
"XHaleOxSw6uQWB/+TznifcC7gB48UOQjCqOKf5VuwQneJLhlhU/jhRV3xtr+hLZa\n" + |
|
582 |
"hW1wYhVi8cjLDrZFKlgEQqhB4crnJU0mJY+tA4IBBQACggEAID0ezl00/X8mv7eb\n" + |
|
583 |
"bzovum1+DEEP7FM57k6HZEG2N3ve4CW+0m9Cd+cWPz8wkZ+M0j/Eqa6F0IdbkXEc\n" + |
|
584 |
"Q7CuzvUyJ57xQ3L/WCgXsiS+Bh8O4Mz7GwW22CGmHqafbVv+hKBfr8MkskO6GJUt\n" + |
|
585 |
"SUF/CVLzB4gMIvZMH26tBP2xK+i7FeEK9kT+nGdzQSZBAhFYpEVCBplHZO24/OYq\n" + |
|
586 |
"1DNoU327nUuXIhmsfA8N0PjiWbIZIjTPwBGr9H0LpATI7DIDNcvRRvtROP+pBU9y\n" + |
|
587 |
"fuykPkptg9C0rCM9t06bukpOSaEz/2VIQdLE8fHYFA6pHZ6CIc2+5cfvMgTPhcjz\n" + |
|
588 |
"W2jCt6MjMCEwHwYDVR0jBBgwFoAUdmae9zvdReU72XI8P/BUOYYxJlMwCwYJYIZI\n" + |
|
589 |
"AWUDBAMCA0gAMEUCIQCeI5fN08b9BpOaHdc3zQNGjp24FOL/RxlBLeBAorswJgIg\n" + |
|
590 |
"JEZ8DhYxQy1O7mmZ2UIT7op6epWMB4dENjs0qWPmcKo=\n" + |
|
42464 | 591 |
"-----END CERTIFICATE-----" |
592 |
}; |
|
593 |
||
594 |
// Private key in the format of PKCS#8. |
|
595 |
private final static String[] endEntityPrivateKeys = { |
|
596 |
// |
|
597 |
// EC private key related to cert endEntityCertStrs[0]. |
|
598 |
// |
|
50768 | 599 |
"MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgn5K03bpTLjEtFQRa\n" + |
600 |
"JUtx22gtmGEvvSUSQdimhGthdtihRANCAARv72fTmp9ed8dRvTG1Ak1Lgl5KLoiM\n" + |
|
601 |
"59bk2pyG8qd8l7L1WQnNHtAcu44RJ1/GVHurxghaCKHeJYsZ8H7DEeI6", |
|
42464 | 602 |
|
603 |
// |
|
604 |
// RSA private key related to cert endEntityCertStrs[1]. |
|
605 |
// |
|
50768 | 606 |
"MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCzN8GhtZ9kinwC\n" + |
607 |
"ALo+JYMNq8/rmZK+AJdQbEAJvFU0B+QuE1FA6weuJEHdfVDee870960LrAqW8T2O\n" + |
|
608 |
"WcMOPsP7WPWvUIc7uazV+ryt9xBh2RqcO27gCUejy/5JJZfXowhcVFgOPZVUebI+\n" + |
|
609 |
"2BuW1yDjMYC7BPvjoV0sj3i5eMmOrUg6v+/RUiXATk5FYfldz7lOP6gVYrQThrgY\n" + |
|
610 |
"cOC0oqGfabvaE3nr8aQ8oaSC4/k1FLWphhX8QWR3JAw5XwnUzsdqJxJ+3g4vp4qN\n" + |
|
611 |
"OuCj3f6QeT62/QNzpylUGdqVfdOisbxAjoFwePVdB3vygCUAL7+MXilzSbCLS6fj\n" + |
|
612 |
"2R0r2BF9AgMBAAECggEASIkPkMCuw4WdTT44IwERus3IOIYOs2IP3BgEDyyvm4B6\n" + |
|
613 |
"JP/iihDWKfA4zEl1Gqcni1RXMHswSglXra682J4kui02Ov+vzEeJIY37Ibn2YnP5\n" + |
|
614 |
"ZjRT2s9GtI/S2o4hl8A/mQb2IMViFC+xKehTukhV4j5d6NPKk0XzLR7gcMjnYxwn\n" + |
|
615 |
"l21fS6D2oM1xRG/di7sL+uLF8EXLRzfiWDNi12uQv4nwtxPKvuKhH6yzHt7YqMH0\n" + |
|
616 |
"46pmDKDaxV4w1JdycjCb6NrCJOYZygoQobuZqOQ30UZoZsPJrtovkncFr1e+lNcO\n" + |
|
617 |
"+aWDfOLCtTH046dEQh5oCShyXMybNlry/QHsOtHOwQKBgQDh2iIjs+FPpQy7Z3EX\n" + |
|
618 |
"DGEvHYqPjrYO9an2KSRr1m9gzRlWYxKY46WmPKwjMerYtra0GP+TBHrgxsfO8tD2\n" + |
|
619 |
"wUAII6sd1qup0a/Sutgf2JxVilLykd0+Ge4/Cs51tCdJ8EqDV2B6WhTewOY2EGvg\n" + |
|
620 |
"JiKYkeNwgRX/9M9CFSAMAk0hUQKBgQDLJAartL3DoGUPjYtpJnfgGM23yAGl6G5r\n" + |
|
621 |
"NSXDn80BiYIC1p0bG3N0xm3yAjqOtJAUj9jZbvDNbCe3GJfLARMr23legX4tRrgZ\n" + |
|
622 |
"nEdKnAFKAKL01oM+A5/lHdkwaZI9yyv+hgSVdYzUjB8rDmzeVQzo1BT7vXypt2yV\n" + |
|
623 |
"6O1OnUpCbQKBgA/0rzDChopv6KRcvHqaX0tK1P0rYeVQqb9ATNhpf9jg5Idb3HZ8\n" + |
|
624 |
"rrk91BNwdVz2G5ZBpdynFl9G69rNAMJOCM4KZw5mmh4XOEq09Ivba8AHU7DbaTv3\n" + |
|
625 |
"7QL7KnbaUWRB26HHzIMYVh0el6T+KADf8NXCiMTr+bfpfbL3dxoiF3zhAoGAbCJD\n" + |
|
626 |
"Qse1dBs/cKYCHfkSOsI5T6kx52Tw0jS6Y4X/FOBjyqr/elyEexbdk8PH9Ar931Qr\n" + |
|
627 |
"NKMvn8oA4iA/PRrXX7M2yi3YQrWwbkGYWYjtzrzEAdzmg+5eARKAeJrZ8/bg9l3U\n" + |
|
628 |
"ttKaItJsDPlizn8rngy3FsJpR9aSAMK6/+wOiYkCgYEA1tZkI1rD1W9NYZtbI9BE\n" + |
|
629 |
"qlJVFi2PBOJMKNuWdouPX3HLQ72GJSQff2BFzLTELjweVVJ0SvY4IipzpQOHQOBy\n" + |
|
630 |
"5qh/p6izXJZh3IHtvwVBjHoEVplg1b2+I5e3jDCfqnwcQw82dW5SxOJMg1h/BD0I\n" + |
|
631 |
"qAL3go42DYeYhu/WnECMeis=", |
|
42464 | 632 |
|
633 |
// |
|
50768 | 634 |
// EC private key related to cert endEntityCertStrs[2]. |
635 |
// |
|
636 |
"MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgGVc7hICpmp91jbYe\n" + |
|
637 |
"nrr8nYHD37RZP3VENY+szuA7WjuhRANCAATn0wRE1OVVnV56mzxnc657lmSBB0+0\n" + |
|
638 |
"P5YgTq2Pc9sgqnEY8PG980/3n0DJCMQr96FZBWsIyY2gSQjNj4ggGAHT", |
|
639 |
||
640 |
// |
|
641 |
// DSA private key related to cert endEntityCertStrs[3]. |
|
42464 | 642 |
// |
50768 | 643 |
"MIICZQIBADCCAjoGByqGSM44BAEwggItAoIBAQCaVq+CgmsxyOpZFVwMTZ2ZYA9E\n" + |
644 |
"SCfNC+d4QN5/rxymsPONLC86zlB4XLHvmJtp2jV7qM7+tbWmsIZYcMPWgD9Ofg+T\n" + |
|
645 |
"e+7SdTHO+XWoBNz5olulRTk6nRu+notsKxBCyVX0V5GHsRvts/qClz+QcIHMSALV\n" + |
|
646 |
"UIrumtxxdbL63pIw4ds0PeH5RtyR9JpS5pWxUk1MPUPoYSV9GPg2bPUEY99Ji8qi\n" + |
|
647 |
"vA1kRTeBfAWC0OgBwbHu1zIKUukMd+pF/D/vKKovJ6I/sPiGXmUw2i4lYOUB0wWn\n" + |
|
648 |
"QUyBLez1UMWKchyvpW0FYxMbv7j5zMcAH7d++vCWo3OEGfe4Uet6Q3/Dx83HAiEA\n" + |
|
649 |
"mjtJp7XNrsgxbRDqETkHhv6zYH8Voo+gDgSO1m7XcH0CggEBAI5moswp++plZSBP\n" + |
|
650 |
"Q9DdCNHt0AV13Toj1jf5M5DNmTX6P6/D/oRfi8Ui1fiCKFv+7lD0J2anCFUaLtu+\n" + |
|
651 |
"j7v78gp5OChDp/n49K6DtKtZZRDmw/Bpm6LNdknmdN5kO5wVzbIXHTCCeNs/CJTF\n" + |
|
652 |
"mSU5PvEaI4y3M5NraSgLPkq4gEv7/A8orGbKmj1Whj3F9t1Tosxdm/+WkPldMz2t\n" + |
|
653 |
"gev+9RM2S6S9XoembRgwRaFVkpQmKoKpOoZcdqV47FLDq5BYH/5POeJ9wLuAHjxQ\n" + |
|
654 |
"5CMKo4p/lW7BCd4kuGWFT+OFFXfG2v6EtlqFbXBiFWLxyMsOtkUqWARCqEHhyucl\n" + |
|
655 |
"TSYlj60EIgIgLfA75+8KcKxdN8mr6gzGjQe7jPFGG42Ejhd7Q2F4wuw=" |
|
656 |
}; |
|
657 |
||
658 |
// Private key algorithm of endEntityPrivateKeys. |
|
659 |
private final static String[] endEntityPrivateKeyAlgs = { |
|
660 |
"EC", |
|
661 |
"RSA", |
|
662 |
"EC", |
|
663 |
"DSA", |
|
42464 | 664 |
}; |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
665 |
|
42464 | 666 |
// Private key names of endEntityPrivateKeys. |
667 |
private final static String[] endEntityPrivateKeyNames = { |
|
50768 | 668 |
"ecdsa", |
669 |
"rsa", |
|
670 |
"ec-rsa", |
|
671 |
"dsa", |
|
42464 | 672 |
}; |
673 |
||
674 |
/* |
|
675 |
* Create an instance of SSLContext with the specified trust/key materials. |
|
676 |
*/ |
|
677 |
private SSLContext createSSLContext( |
|
678 |
String[] trustedMaterials, |
|
679 |
String[] keyMaterialCerts, |
|
680 |
String[] keyMaterialKeys, |
|
681 |
String[] keyMaterialKeyAlgs, |
|
50768 | 682 |
String[] keyMaterialKeyNames, |
42464 | 683 |
ContextParameters params) throws Exception { |
684 |
||
685 |
KeyStore ts = null; // trust store |
|
686 |
KeyStore ks = null; // key store |
|
687 |
char passphrase[] = "passphrase".toCharArray(); |
|
688 |
||
689 |
// Generate certificate from cert string. |
|
690 |
CertificateFactory cf = CertificateFactory.getInstance("X.509"); |
|
691 |
||
692 |
// Import the trused certs. |
|
693 |
ByteArrayInputStream is; |
|
694 |
if (trustedMaterials != null && trustedMaterials.length != 0) { |
|
695 |
ts = KeyStore.getInstance("JKS"); |
|
696 |
ts.load(null, null); |
|
697 |
||
698 |
Certificate[] trustedCert = |
|
699 |
new Certificate[trustedMaterials.length]; |
|
700 |
for (int i = 0; i < trustedMaterials.length; i++) { |
|
701 |
String trustedCertStr = trustedMaterials[i]; |
|
702 |
||
703 |
is = new ByteArrayInputStream(trustedCertStr.getBytes()); |
|
704 |
try { |
|
705 |
trustedCert[i] = cf.generateCertificate(is); |
|
706 |
} finally { |
|
707 |
is.close(); |
|
708 |
} |
|
709 |
||
710 |
ts.setCertificateEntry("trusted-cert-" + i, trustedCert[i]); |
|
711 |
} |
|
712 |
} |
|
713 |
||
714 |
// Import the key materials. |
|
715 |
// |
|
716 |
// Note that certification pathes bigger than one are not supported yet. |
|
717 |
boolean hasKeyMaterials = |
|
718 |
(keyMaterialCerts != null) && (keyMaterialCerts.length != 0) && |
|
719 |
(keyMaterialKeys != null) && (keyMaterialKeys.length != 0) && |
|
720 |
(keyMaterialKeyAlgs != null) && (keyMaterialKeyAlgs.length != 0) && |
|
721 |
(keyMaterialCerts.length == keyMaterialKeys.length) && |
|
722 |
(keyMaterialCerts.length == keyMaterialKeyAlgs.length); |
|
723 |
if (hasKeyMaterials) { |
|
724 |
ks = KeyStore.getInstance("JKS"); |
|
725 |
ks.load(null, null); |
|
726 |
||
727 |
for (int i = 0; i < keyMaterialCerts.length; i++) { |
|
728 |
String keyCertStr = keyMaterialCerts[i]; |
|
729 |
||
730 |
// generate the private key. |
|
731 |
PKCS8EncodedKeySpec priKeySpec = new PKCS8EncodedKeySpec( |
|
732 |
Base64.getMimeDecoder().decode(keyMaterialKeys[i])); |
|
733 |
KeyFactory kf = |
|
734 |
KeyFactory.getInstance(keyMaterialKeyAlgs[i]); |
|
735 |
PrivateKey priKey = kf.generatePrivate(priKeySpec); |
|
736 |
||
737 |
// generate certificate chain |
|
738 |
is = new ByteArrayInputStream(keyCertStr.getBytes()); |
|
739 |
Certificate keyCert = null; |
|
740 |
try { |
|
741 |
keyCert = cf.generateCertificate(is); |
|
742 |
} finally { |
|
743 |
is.close(); |
|
744 |
} |
|
745 |
||
746 |
Certificate[] chain = new Certificate[] { keyCert }; |
|
747 |
||
748 |
// import the key entry. |
|
50768 | 749 |
ks.setKeyEntry("cert-" + keyMaterialKeyNames[i], |
42464 | 750 |
priKey, passphrase, chain); |
751 |
} |
|
752 |
} |
|
753 |
||
754 |
// Create an SSLContext object. |
|
755 |
TrustManagerFactory tmf = |
|
756 |
TrustManagerFactory.getInstance(params.tmAlgorithm); |
|
757 |
tmf.init(ts); |
|
758 |
||
759 |
SSLContext context = SSLContext.getInstance(params.contextProtocol); |
|
760 |
if (hasKeyMaterials && ks != null) { |
|
761 |
KeyManagerFactory kmf = |
|
762 |
KeyManagerFactory.getInstance(params.kmAlgorithm); |
|
763 |
kmf.init(ks, passphrase); |
|
764 |
||
765 |
context.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); |
|
766 |
} else { |
|
767 |
context.init(null, tmf.getTrustManagers(), null); |
|
768 |
} |
|
769 |
||
770 |
return context; |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
771 |
} |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
772 |
|
42464 | 773 |
/* |
774 |
* ================================================= |
|
775 |
* Stuffs to boot up the client-server mode testing. |
|
776 |
*/ |
|
777 |
private Thread clientThread = null; |
|
778 |
private Thread serverThread = null; |
|
779 |
private volatile Exception serverException = null; |
|
780 |
private volatile Exception clientException = null; |
|
781 |
||
782 |
/* |
|
783 |
* Should we run the client or server in a separate thread? |
|
784 |
* Both sides can throw exceptions, but do you have a preference |
|
785 |
* as to which side should be the main thread. |
|
786 |
*/ |
|
787 |
private static final boolean separateServerThread = false; |
|
788 |
||
789 |
/* |
|
790 |
* Boot up the testing, used to drive remainder of the test. |
|
791 |
*/ |
|
792 |
private void bootup() throws Exception { |
|
793 |
Exception startException = null; |
|
794 |
try { |
|
795 |
if (separateServerThread) { |
|
796 |
startServer(true); |
|
797 |
startClient(false); |
|
798 |
} else { |
|
799 |
startClient(true); |
|
800 |
startServer(false); |
|
801 |
} |
|
802 |
} catch (Exception e) { |
|
803 |
startException = e; |
|
804 |
} |
|
805 |
||
806 |
/* |
|
807 |
* Wait for other side to close down. |
|
808 |
*/ |
|
809 |
if (separateServerThread) { |
|
810 |
if (serverThread != null) { |
|
811 |
serverThread.join(); |
|
812 |
} |
|
813 |
} else { |
|
814 |
if (clientThread != null) { |
|
815 |
clientThread.join(); |
|
816 |
} |
|
817 |
} |
|
42155
c9b28ab5297b
8168969: Merge SSLSocketSample and SSLSocketTemplate
asmotrak
parents:
41595
diff
changeset
|
818 |
|
42464 | 819 |
/* |
820 |
* When we get here, the test is pretty much over. |
|
821 |
* Which side threw the error? |
|
822 |
*/ |
|
823 |
Exception local; |
|
824 |
Exception remote; |
|
825 |
||
826 |
if (separateServerThread) { |
|
827 |
remote = serverException; |
|
828 |
local = clientException; |
|
829 |
} else { |
|
830 |
remote = clientException; |
|
831 |
local = serverException; |
|
832 |
} |
|
833 |
||
834 |
Exception exception = null; |
|
835 |
||
836 |
/* |
|
837 |
* Check various exception conditions. |
|
838 |
*/ |
|
839 |
if ((local != null) && (remote != null)) { |
|
840 |
// If both failed, return the curthread's exception. |
|
841 |
local.initCause(remote); |
|
842 |
exception = local; |
|
843 |
} else if (local != null) { |
|
844 |
exception = local; |
|
845 |
} else if (remote != null) { |
|
846 |
exception = remote; |
|
847 |
} else if (startException != null) { |
|
848 |
exception = startException; |
|
849 |
} |
|
850 |
||
851 |
/* |
|
852 |
* If there was an exception *AND* a startException, |
|
853 |
* output it. |
|
854 |
*/ |
|
855 |
if (exception != null) { |
|
856 |
if (exception != startException && startException != null) { |
|
857 |
exception.addSuppressed(startException); |
|
858 |
} |
|
859 |
throw exception; |
|
860 |
} |
|
861 |
||
862 |
// Fall-through: no exception to throw! |
|
863 |
} |
|
864 |
||
865 |
private void startServer(boolean newThread) throws Exception { |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
866 |
if (newThread) { |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
867 |
serverThread = new Thread() { |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
868 |
@Override |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
869 |
public void run() { |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
870 |
try { |
42464 | 871 |
doServerSide(); |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
872 |
} catch (Exception e) { |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
873 |
/* |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
874 |
* Our server thread just died. |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
875 |
* |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
876 |
* Release the client, if not active already... |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
877 |
*/ |
42464 | 878 |
logException("Server died", e); |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
879 |
serverException = e; |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
880 |
} |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
881 |
} |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
882 |
}; |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
883 |
serverThread.start(); |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
884 |
} else { |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
885 |
try { |
42464 | 886 |
doServerSide(); |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
887 |
} catch (Exception e) { |
42464 | 888 |
logException("Server failed", e); |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
889 |
serverException = e; |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
890 |
} |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
891 |
} |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
892 |
} |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
893 |
|
42464 | 894 |
private void startClient(boolean newThread) throws Exception { |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
895 |
if (newThread) { |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
896 |
clientThread = new Thread() { |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
897 |
@Override |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
898 |
public void run() { |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
899 |
try { |
42464 | 900 |
doClientSide(); |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
901 |
} catch (Exception e) { |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
902 |
/* |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
903 |
* Our client thread just died. |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
904 |
*/ |
42464 | 905 |
logException("Client died", e); |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
906 |
clientException = e; |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
907 |
} |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
908 |
} |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
909 |
}; |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
910 |
clientThread.start(); |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
911 |
} else { |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
912 |
try { |
42464 | 913 |
doClientSide(); |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
914 |
} catch (Exception e) { |
42464 | 915 |
logException("Client failed", e); |
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
916 |
clientException = e; |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
917 |
} |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
918 |
} |
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
919 |
} |
42464 | 920 |
|
921 |
private synchronized void logException(String prefix, Throwable cause) { |
|
922 |
System.out.println(prefix + ": " + cause); |
|
923 |
cause.printStackTrace(System.out); |
|
924 |
} |
|
41196
240314163e51
8164591: sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java failed with SSLHandshakeException
asmotrak
parents:
diff
changeset
|
925 |
} |