File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
test/jdk/javax/net/ssl/templates Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2016, 2023 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2016, 2024 , 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
@@ -273,7 +273,7 @@ protected void doClientSide() throws Exception {
273273 configureClientSocket (sslSocket );
274274 InetAddress serverAddress = this .serverAddress ;
275275 InetSocketAddress connectAddress = serverAddress == null
276- ? new InetSocketAddress ("localhost" , serverPort )
276+ ? new InetSocketAddress (InetAddress . getLoopbackAddress () , serverPort )
277277 : new InetSocketAddress (serverAddress , serverPort );
278278 sslSocket .connect (connectAddress , 15000 );
279279 } catch (IOException ioe ) {
Original file line number Diff line number Diff line change 2323
2424import javax .net .ssl .*;
2525import java .io .*;
26+ import java .net .InetAddress ;
2627import java .net .InetSocketAddress ;
2728import java .security .KeyStore ;
2829import java .security .cert .PKIXBuilderParameters ;
@@ -334,7 +335,7 @@ public SSLSocket connect() {
334335 sslContext = SSLContext .getInstance ("TLS" );
335336 sslContext .init (TLSBase .getKeyManager (km ), TLSBase .getTrustManager (tm ), null );
336337 sock = (SSLSocket )sslContext .getSocketFactory ().createSocket ();
337- sock .connect (new InetSocketAddress ("localhost" , serverPort ));
338+ sock .connect (new InetSocketAddress (InetAddress . getLoopbackAddress () , serverPort ));
338339 System .err .println ("Client connected using port " +
339340 sock .getLocalPort ());
340341 name = "client(" + sock .toString () + ")" ;
You can’t perform that action at this time.
0 commit comments