< prev index next >

test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/HttpServerAdapters.java

Print this page
@@ -28,11 +28,10 @@
  import com.sun.net.httpserver.Headers;
  import com.sun.net.httpserver.HttpContext;
  import com.sun.net.httpserver.HttpExchange;
  import com.sun.net.httpserver.HttpHandler;
  import com.sun.net.httpserver.HttpServer;
- import com.sun.net.httpserver.HttpsConfigurator;
  import com.sun.net.httpserver.HttpsServer;
  import jdk.httpclient.test.lib.http2.Http2Handler;
  import jdk.httpclient.test.lib.http2.Http2TestExchange;
  import jdk.httpclient.test.lib.http2.Http2TestServer;
  import jdk.internal.net.http.common.HttpHeadersBuilder;

@@ -796,18 +795,18 @@
                          throw new IOException(e);
                      }
                      return HttpTestServer.of(underlying);
                  }
                  case HTTP_1_1 ->  {
-                     InetSocketAddress sa = new InetSocketAddress(
-                             InetAddress.getLoopbackAddress(), 0);
+                     InetAddress loopback = InetAddress.getLoopbackAddress();
+                     InetSocketAddress sa = new InetSocketAddress(loopback, 0);
                      HttpServer underlying;
                      if (sslContext == null) {
                          underlying = HttpServer.create(sa, 0); // HTTP
                      } else {
                          HttpsServer https = HttpsServer.create(sa, 0); // HTTPS
-                         https.setHttpsConfigurator(new HttpsConfigurator(sslContext));
+                         https.setHttpsConfigurator(new TestServerConfigurator(loopback, sslContext));
                          underlying = https;
                      }
                      if (executor != null) {
                          underlying.setExecutor(executor);
                      }
< prev index next >