Skip to content

Commit

Permalink
8280546: Remove hard-coded 127.0.0.1 loopback address
Browse files Browse the repository at this point in the history
Reviewed-by: mullan
  • Loading branch information
cushon committed Jan 26, 2022
1 parent 0c42e43 commit b5de2cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion test/jdk/javax/net/ssl/TLS/TestJSSE.java
Expand Up @@ -21,12 +21,13 @@
* questions.
*/

import java.net.InetAddress;
import java.security.Provider;
import java.security.Security;

public class TestJSSE {

private static final String LOCAL_IP = "127.0.0.1";
private static final String LOCAL_IP = InetAddress.getLoopbackAddress().getHostAddress();

public static void main(String... args) throws Exception {
// reset the security property to make sure that the algorithms
Expand Down
4 changes: 3 additions & 1 deletion test/jdk/javax/net/ssl/sanity/interop/JSSEClient.java
Expand Up @@ -23,6 +23,7 @@

import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetAddress;
import java.security.cert.Certificate;

import javax.net.ssl.KeyManager;
Expand Down Expand Up @@ -52,7 +53,8 @@ void runTest(CipherTest.TestParameters params) throws Exception {
new TrustManager[] { CipherTest.trustManager },
CipherTest.secureRandom);
SSLSocketFactory factory = (SSLSocketFactory)sslContext.getSocketFactory();
socket = (SSLSocket)factory.createSocket("127.0.0.1", CipherTest.serverPort);
socket = (SSLSocket)factory.createSocket(
InetAddress.getLoopbackAddress().getHostAddress(), CipherTest.serverPort);
socket.setSoTimeout(CipherTest.TIMEOUT);
socket.setEnabledCipherSuites(new String[] { params.cipherSuite.name() });
socket.setEnabledProtocols(new String[] { params.protocol.name });
Expand Down

5 comments on commit b5de2cc

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on b5de2cc Mar 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on b5de2cc Mar 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin the backport was successfully created on the branch backport-GoeLin-b5de2cc9 in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit b5de2cc9 from the openjdk/jdk repository.

The commit being backported was authored by Liam Miller-Cushon on 26 Jan 2022 and was reviewed by Sean Mullan.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev.git backport-GoeLin-b5de2cc9:backport-GoeLin-b5de2cc9
$ git checkout backport-GoeLin-b5de2cc9
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev.git backport-GoeLin-b5de2cc9

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on b5de2cc Mar 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk11u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on b5de2cc Mar 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin the backport was successfully created on the branch backport-GoeLin-b5de2cc9 in my personal fork of openjdk/jdk11u-dev. To create a pull request with this backport targeting openjdk/jdk11u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit b5de2cc9 from the openjdk/jdk repository.

The commit being backported was authored by Liam Miller-Cushon on 26 Jan 2022 and was reviewed by Sean Mullan.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk11u-dev:

$ git fetch https://github.com/openjdk-bots/jdk11u-dev.git backport-GoeLin-b5de2cc9:backport-GoeLin-b5de2cc9
$ git checkout backport-GoeLin-b5de2cc9
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk11u-dev.git backport-GoeLin-b5de2cc9

Please sign in to comment.