src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java
Print this page
8144566 Custom HostnameVerifier disables SNI extension
*** 2129,2139 ****
--- 2129,2143 ----
// may override SNIHostName in the customized server name indication.
public synchronized void setHost(String host) {
this.host = host;
this.serverNames =
Utilities.addToSNIServerNameList(this.serverNames, this.host);
+
+ if (!roleIsServer && (handshaker != null) && !handshaker.started()) {
+ handshaker.setSNIServerNames(serverNames);
}
+ }
/**
* Gets an input stream to read from the peer on the other side.
* Data read from this stream was always integrity protected in
* transit, and will usually have been confidentiality protected.