-
Notifications
You must be signed in to change notification settings - Fork 155
Throw AuthenticationException if failed to conn due to auth errors #315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -81,7 +82,7 @@ public static TLSSocketChannel create( ByteChannel channel, Logger logger, SSLEn | |||
} | |||
catch ( SSLHandshakeException e ) | |||
{ | |||
throw new ClientException( "Failed to establish secured connection with the server: " + e.getMessage(), e ); | |||
throw new UnauthorizedException( "Failed to establish secured connection with the server: " + e.getMessage(), e ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that we should reuse UnauthorizedException
for TLS handshake failure as well as for actual login failure. The Python driver uses ServiceUnavailable
here but that doesn't seem quite right either.
Perhaps we should have something separate such as SecurityLayerUnavailable
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to have fewer public errors. So how about change both of them to SecurityException
/AuthorizationException
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for AuthorizationException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the name is fine as-is for login failure but why would fewer errors be useful here? Login failure could trigger an application code path that requires the user to enter new login details whereas an SSL handshake failure should not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhenlineo changes look good, name of UnauthorizedException
is probably the only thing that could be improved.
Will merge this one latter after the big routing specification change, as it should be easier to rebase this PR |
This includes the error that the client provide a wrong credentials and the server provides a wrong certificate.
…rity Changed from UnauthorizedException to AuthenticationException for wrong username/password Use SecurityException for failed to tls handshake
ab35aab
to
19b45fd
Compare
This includes the error that the client provide a wrong credentials and
the server provides a wrong certificate.