Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8260925: HttpsURLConnection does not work with other JSSE provider.
Reviewed-by: xuelei
  • Loading branch information
Vyom Tewari committed Mar 5, 2021
1 parent dbef0ec commit 80182f92db9425619a30a6cd5f3c996b64a882ea
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java
@@ -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;
@@ -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;

0 comments on commit 80182f9

Please sign in to comment.