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

View file

@ -650,8 +650,10 @@ public final class SSLSocketImpl
// Use user_canceled alert regardless the protocol versions. // Use user_canceled alert regardless the protocol versions.
useUserCanceled = true; useUserCanceled = true;
// The protocol version may have been negotiated. // The protocol version may have been negotiated. The
ProtocolVersion pv = conContext.handshakeContext.negotiatedProtocol; // 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())) { if (pv == null || (!pv.useTLS13PlusSpec())) {
hasCloseReceipt = true; hasCloseReceipt = true;
} }
@ -1386,7 +1388,6 @@ public final class SSLSocketImpl
} finally { } finally {
socketLock.unlock(); socketLock.unlock();
} }
return null; return null;
} }