8290005: com/sun/jndi/ldap/LdapCBPropertiesTest.java failling with NullPointerException

Reviewed-by: jnimeh, xuelei
This commit is contained in:
Matthew Donovan 2023-07-17 11:16:19 +00:00
parent acf591e856
commit afcf8e4751

@ -650,8 +650,10 @@ public final class SSLSocketImpl
// Use user_canceled alert regardless the protocol versions.
useUserCanceled = true;
// The protocol version may have been negotiated.
ProtocolVersion pv = conContext.handshakeContext.negotiatedProtocol;
// The protocol version may have been negotiated. The
// conContext.handshakeContext.negotiatedProtocol is not used as there
// may be a race to set it to null.
ProtocolVersion pv = conContext.protocolVersion;
if (pv == null || (!pv.useTLS13PlusSpec())) {
hasCloseReceipt = true;
}
@ -1386,7 +1388,6 @@ public final class SSLSocketImpl
} finally {
socketLock.unlock();
}
return null;
}