8239798: SSLSocket closes socket both socket endpoints on a SocketTimeoutException

Reviewed-by: xuelei
This commit is contained in:
Alexey Bakhtin 2020-03-11 19:14:08 +03:00 committed by Andrew Brygin
parent 6275aee690
commit 14e37ba3df
5 changed files with 128 additions and 113 deletions

View file

@ -436,6 +436,8 @@ public final class SSLSocketImpl
if (!conContext.isNegotiated) {
readHandshakeRecord();
}
} catch (InterruptedIOException iioe) {
handleException(iioe);
} catch (IOException ioe) {
throw conContext.fatal(Alert.HANDSHAKE_FAILURE,
"Couldn't kickstart handshaking", ioe);
@ -1374,12 +1376,11 @@ public final class SSLSocketImpl
}
} catch (SSLException ssle) {
throw ssle;
} catch (InterruptedIOException iioe) {
// don't change exception in case of timeouts or interrupts
throw iioe;
} catch (IOException ioe) {
if (!(ioe instanceof SSLException)) {
throw new SSLException("readHandshakeRecord", ioe);
} else {
throw ioe;
}
throw new SSLException("readHandshakeRecord", ioe);
}
}
@ -1440,6 +1441,9 @@ public final class SSLSocketImpl
}
} catch (SSLException ssle) {
throw ssle;
} catch (InterruptedIOException iioe) {
// don't change exception in case of timeouts or interrupts
throw iioe;
} catch (IOException ioe) {
if (!(ioe instanceof SSLException)) {
throw new SSLException("readApplicationRecord", ioe);