Always include initial handshake exception when throwing SslHandshakeException (#9008)
Motivation: A callback may already have stored a initial handshake exception in ReferenceCountedOpenSslEngine so we should include it when throwing a SslHandshakeException to ensure the user has all the infos when debugging. Modifications: Include initial handshake exception Result: Include all erros when throwing the SslHandshakeException.
This commit is contained in:
parent
ad928c19eb
commit
547a375737
@ -966,7 +966,14 @@ public class ReferenceCountedOpenSslEngine extends SSLEngine implements Referenc
|
||||
if (handshakeState == HandshakeState.FINISHED) {
|
||||
return new SSLException(errorString);
|
||||
}
|
||||
return new SSLHandshakeException(errorString);
|
||||
|
||||
SSLHandshakeException exception = new SSLHandshakeException(errorString);
|
||||
// If we have a handshakeException stored already we should include it as well to help the user debug things.
|
||||
if (handshakeException != null) {
|
||||
exception.initCause(handshakeException);
|
||||
handshakeException = null;
|
||||
}
|
||||
return exception;
|
||||
}
|
||||
|
||||
public final SSLEngineResult unwrap(
|
||||
|
Loading…
Reference in New Issue
Block a user