Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jdk17u
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
einsteinathome
openjdk
jdk17u
Commits
f4489554
Commit
f4489554
authored
6 months ago
by
Goetz Lindenmaier
Browse files
Options
Downloads
Patches
Plain Diff
8330278: Have SSLSocketTemplate.doClientSide use loopback address
Backport-of: 0eff492e4107abc5624f0c3445877bf38629a980
parent
c41236b7
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java
+2
-2
2 additions, 2 deletions
test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java
test/jdk/javax/net/ssl/templates/TLSBase.java
+2
-1
2 additions, 1 deletion
test/jdk/javax/net/ssl/templates/TLSBase.java
with
4 additions
and
3 deletions
test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java
+
2
−
2
View file @
f4489554
/*
* Copyright (c) 2016, 202
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 202
4
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -273,7 +273,7 @@ public class SSLSocketTemplate extends SSLContextTemplate {
configureClientSocket
(
sslSocket
);
InetAddress
serverAddress
=
this
.
serverAddress
;
InetSocketAddress
connectAddress
=
serverAddress
==
null
?
new
InetSocketAddress
(
"localhost"
,
serverPort
)
?
new
InetSocketAddress
(
InetAddress
.
getLoopbackAddress
()
,
serverPort
)
:
new
InetSocketAddress
(
serverAddress
,
serverPort
);
sslSocket
.
connect
(
connectAddress
,
15000
);
}
catch
(
IOException
ioe
)
{
...
...
This diff is collapsed.
Click to expand it.
test/jdk/javax/net/ssl/templates/TLSBase.java
+
2
−
1
View file @
f4489554
...
...
@@ -31,6 +31,7 @@ import java.io.IOException;
import
java.io.InputStreamReader
;
import
java.io.OutputStreamWriter
;
import
java.io.PrintWriter
;
import
java.net.InetAddress
;
import
java.net.InetSocketAddress
;
import
java.util.Arrays
;
import
java.util.concurrent.ConcurrentHashMap
;
...
...
@@ -222,7 +223,7 @@ abstract public class TLSBase {
try
{
sslContext
=
SSLContext
.
getDefault
();
sock
=
(
SSLSocket
)
sslContext
.
getSocketFactory
().
createSocket
();
sock
.
connect
(
new
InetSocketAddress
(
"localhost"
,
serverPort
));
sock
.
connect
(
new
InetSocketAddress
(
InetAddress
.
getLoopbackAddress
()
,
serverPort
));
System
.
err
.
println
(
"Client connected using port "
+
sock
.
getLocalPort
());
name
=
"client("
+
sock
.
toString
()
+
")"
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment