Skip to content

Commit

Permalink
8260925: HttpsURLConnection does not work with other JSSE provider.
Browse files Browse the repository at this point in the history
Reviewed-by: xuelei
  • Loading branch information
Vyom Tewari committed Mar 5, 2021
1 parent dbef0ec commit 80182f9
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -39,6 +39,7 @@
import java.net.Proxy;
import java.security.Principal;
import java.security.cert.*;
import java.util.List;
import java.util.Objects;
import java.util.StringTokenizer;
import java.util.Vector;
Expand Down Expand Up @@ -565,6 +566,10 @@ public void afterConnect() throws IOException, UnknownHostException {
// will do the spoof checks in SSLSocket.
SSLParameters paramaters = s.getSSLParameters();
paramaters.setEndpointIdentificationAlgorithm("HTTPS");
// host has been set previously for SSLSocketImpl
if (!(s instanceof SSLSocketImpl)) {
paramaters.setServerNames(List.of(new SNIHostName(host)));
}
s.setSSLParameters(paramaters);

needToCheckSpoofing = false;
Expand Down

2 comments on commit 80182f9

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@zxcvbnmlkjh
Copy link

@zxcvbnmlkjh zxcvbnmlkjh commented on 80182f9 Mar 26, 2022

Choose a reason for hiding this comment

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

Hi @zxcvbnmlkjh, thanks for making a comment in an OpenJDK project!

All comments and discussions in the OpenJDK Community must be made available under the OpenJDK Terms of Use. If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please Use "Add GitHub user zxcvbnmlkjh for the summary.

If you are not an OpenJDK Author, Committer or Reviewer, simply check the box below to accept the OpenJDK Terms of Use for your comments.

Your comment will be automatically restored once you have accepted the OpenJDK Terms of Use.

Please sign in to comment.