8242294: JSSE Client does not throw SSLException when an alert occurs during handshaking

Reviewed-by: xuelei
This commit is contained in:
Jamil Nimeh 2020-04-08 00:03:56 -07:00
parent 67fd181eb8
commit 6b7a466f74
2 changed files with 261 additions and 3 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1111,9 +1111,17 @@ public final class SSLSocketImpl
* or has been closed, throw an Exception.
*/
private boolean checkEOF() throws IOException {
if (conContext.isInboundClosed()) {
if (conContext.isBroken) {
if (conContext.closeReason == null) {
return true;
} else {
throw new SSLException(
"Connection has closed: " + conContext.closeReason,
conContext.closeReason);
}
} else if (conContext.isInboundClosed()) {
return true;
} else if (conContext.isInputCloseNotified || conContext.isBroken) {
} else if (conContext.isInputCloseNotified) {
if (conContext.closeReason == null) {
return true;
} else {