< prev index next >
src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java
Print this page
rev 51919 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: dfuchs, alanb
*** 1202,1212 ****
* Called by connect, the layered constructor, and SSLServerSocket.
*/
synchronized void doneConnect() throws IOException {
// In server mode, it is not necessary to set host and serverNames.
// Otherwise, would require a reverse DNS lookup to get the hostname.
! if ((peerHost == null) || (peerHost.length() == 0)) {
boolean useNameService =
trustNameService && conContext.sslConfig.isClientMode;
useImplicitHost(useNameService);
} else {
conContext.sslConfig.serverNames =
--- 1202,1212 ----
* Called by connect, the layered constructor, and SSLServerSocket.
*/
synchronized void doneConnect() throws IOException {
// In server mode, it is not necessary to set host and serverNames.
// Otherwise, would require a reverse DNS lookup to get the hostname.
! if (peerHost == null || peerHost.isEmpty()) {
boolean useNameService =
trustNameService && conContext.sslConfig.isClientMode;
useImplicitHost(useNameService);
} else {
conContext.sslConfig.serverNames =
*** 1237,1248 ****
}
JavaNetInetAddressAccess jna =
SharedSecrets.getJavaNetInetAddressAccess();
String originalHostname = jna.getOriginalHostName(inetAddress);
! if ((originalHostname != null) &&
! (originalHostname.length() != 0)) {
this.peerHost = originalHostname;
if (conContext.sslConfig.serverNames.isEmpty() &&
!conContext.sslConfig.noSniExtension) {
conContext.sslConfig.serverNames =
--- 1237,1247 ----
}
JavaNetInetAddressAccess jna =
SharedSecrets.getJavaNetInetAddressAccess();
String originalHostname = jna.getOriginalHostName(inetAddress);
! if (originalHostname != null && !originalHostname.isEmpty()) {
this.peerHost = originalHostname;
if (conContext.sslConfig.serverNames.isEmpty() &&
!conContext.sslConfig.noSniExtension) {
conContext.sslConfig.serverNames =
< prev index next >