equal
deleted
inserted
replaced
30 * @run testng/othervm -Djdk.internal.httpclient.debug=true InvalidSSLContextTest |
30 * @run testng/othervm -Djdk.internal.httpclient.debug=true InvalidSSLContextTest |
31 */ |
31 */ |
32 |
32 |
33 import java.io.IOException; |
33 import java.io.IOException; |
34 import java.io.UncheckedIOException; |
34 import java.io.UncheckedIOException; |
|
35 import java.net.InetAddress; |
35 import java.net.InetSocketAddress; |
36 import java.net.InetSocketAddress; |
36 import java.net.URI; |
37 import java.net.URI; |
37 import java.util.concurrent.CompletableFuture; |
38 import java.util.concurrent.CompletableFuture; |
38 import java.util.concurrent.CompletionException; |
39 import java.util.concurrent.CompletionException; |
39 import javax.net.ssl.SSLContext; |
40 import javax.net.ssl.SSLContext; |
142 // server-side uses a different context to that of the client-side |
143 // server-side uses a different context to that of the client-side |
143 sslServerSocket = (SSLServerSocket)sslContext |
144 sslServerSocket = (SSLServerSocket)sslContext |
144 .getServerSocketFactory() |
145 .getServerSocketFactory() |
145 .createServerSocket(); |
146 .createServerSocket(); |
146 sslServerSocket.setReuseAddress(false); |
147 sslServerSocket.setReuseAddress(false); |
147 sslServerSocket.bind(new InetSocketAddress(0)); |
148 InetSocketAddress addr = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); |
|
149 sslServerSocket.bind(addr); |
148 uri = "https://localhost:" + sslServerSocket.getLocalPort() + "/"; |
150 uri = "https://localhost:" + sslServerSocket.getLocalPort() + "/"; |
149 |
151 |
150 Thread t = new Thread("SSL-Server-Side") { |
152 Thread t = new Thread("SSL-Server-Side") { |
151 @Override |
153 @Override |
152 public void run() { |
154 public void run() { |