mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8237578: JDK-8214339 (SSLSocketImpl wraps SocketException) appears to not be fully fixed
Reviewed-by: xuelei, simonis
This commit is contained in:
parent
1bd015fb0c
commit
01b2804ef7
5 changed files with 182 additions and 7 deletions
|
@ -447,6 +447,8 @@ public final class SSLSocketImpl
|
|||
throw conContext.fatal(Alert.HANDSHAKE_FAILURE,
|
||||
"Couldn't kickstart handshaking", iioe);
|
||||
}
|
||||
} catch (SocketException se) {
|
||||
handleException(se);
|
||||
} catch (IOException ioe) {
|
||||
throw conContext.fatal(Alert.HANDSHAKE_FAILURE,
|
||||
"Couldn't kickstart handshaking", ioe);
|
||||
|
@ -1411,6 +1413,9 @@ public final class SSLSocketImpl
|
|||
} catch (InterruptedIOException iioe) {
|
||||
// don't change exception in case of timeouts or interrupts
|
||||
throw iioe;
|
||||
} catch (SocketException se) {
|
||||
// don't change exception in case of SocketException
|
||||
throw se;
|
||||
} catch (IOException ioe) {
|
||||
throw new SSLException("readHandshakeRecord", ioe);
|
||||
}
|
||||
|
@ -1476,6 +1481,9 @@ public final class SSLSocketImpl
|
|||
} catch (InterruptedIOException iioe) {
|
||||
// don't change exception in case of timeouts or interrupts
|
||||
throw iioe;
|
||||
} catch (SocketException se) {
|
||||
// don't change exception in case of SocketException
|
||||
throw se;
|
||||
} catch (IOException ioe) {
|
||||
if (!(ioe instanceof SSLException)) {
|
||||
throw new SSLException("readApplicationRecord", ioe);
|
||||
|
@ -1687,6 +1695,16 @@ public final class SSLSocketImpl
|
|||
}
|
||||
}
|
||||
|
||||
if (cause instanceof SocketException) {
|
||||
try {
|
||||
conContext.fatal(alert, cause);
|
||||
} catch (Exception e) {
|
||||
// Just delivering the fatal alert, re-throw the socket exception instead.
|
||||
}
|
||||
|
||||
throw (SocketException)cause;
|
||||
}
|
||||
|
||||
throw conContext.fatal(alert, cause);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue