8282600: SSLSocketImpl should not use user_canceled workaround when not necessary

Reviewed-by: xuelei, wetmore
This commit is contained in:
Zdenek Zambersky 2022-05-05 12:13:20 +00:00 committed by Severin Gehwolf
parent 81d7475d20
commit 7e88ff8a82

@ -639,8 +639,12 @@ public final class SSLSocketImpl
if (!conContext.protocolVersion.useTLS13PlusSpec()) {
hasCloseReceipt = true;
} else {
// Use a user_canceled alert for TLS 1.3 duplex close.
useUserCanceled = true;
// Do not use user_canceled workaround if the other side has
// already half-closed the connection
if (!conContext.isInboundClosed()) {
// Use a user_canceled alert for TLS 1.3 duplex close.
useUserCanceled = true;
}
}
} else if (conContext.handshakeContext != null) { // initial handshake
// Use user_canceled alert regardless the protocol versions.