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 3131import java .io .InputStreamReader ;
3232import java .io .OutputStreamWriter ;
3333import java .io .PrintWriter ;
34+ import java .net .InetAddress ;
3435import java .net .InetSocketAddress ;
3536import java .util .Arrays ;
3637import java .util .concurrent .ConcurrentHashMap ;
@@ -222,7 +223,7 @@ public SSLSocket connect() {
222223 try {
223224 sslContext = SSLContext .getDefault ();
224225 sock = (SSLSocket )sslContext .getSocketFactory ().createSocket ();
225- sock .connect (new InetSocketAddress ("localhost" , serverPort ));
226+ sock .connect (new InetSocketAddress (InetAddress . getLoopbackAddress () , serverPort ));
226227 System .err .println ("Client connected using port " +
227228 sock .getLocalPort ());
228229 name = "client(" + sock .toString () + ")" ;
You can’t perform that action at this time.
0 commit comments