8325022: Incorrect error message on client authentication#17645
8325022: Incorrect error message on client authentication#17645johnshajiang wants to merge 2 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back jjiang! A progress list of the required criteria for merging this PR into |
|
@johnshajiang The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
|
@johnshajiang This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 12 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
|
LGTM |
djelinski
left a comment
There was a problem hiding this comment.
Looks good, but could you also fix the messages on line 406 and 1227?
| // unexpected or require client authentication | ||
| throw shc.conContext.fatal(Alert.BAD_CERTIFICATE, | ||
| "Empty server certificate chain"); | ||
| "Empty client certificate chain"); |
There was a problem hiding this comment.
Hm, in tls1.3 it should be certificate_required and in 1.2 handshake_failure for required auth.
rfc8446 6.2 “certificate_required: Sent by servers when a client certificate is
desired but none was provided by the client.”
rfc5246 7.4.6 “ If the client does not send any certificates, the
server MAY at its discretion either continue the handshake without
client authentication, or respond with a fatal handshake_failure
alert.”
There was a problem hiding this comment.
Thanks for raising this point.
I just filed a JBS issue: https://bugs.openjdk.org/browse/JDK-8325079
There was a problem hiding this comment.
I'm not so sure about :
if (shc.sslConfig.clientAuthType !=
ClientAuthType.CLIENT_AUTH_REQUESTED) {
// unexpected or require client authenticationI mean cert chain should not be null/empty if CLIENT_AUTH_REQUIRED for sure.
But for CLIENT_AUTH_NONE, I don't know if this makes sense. (maybe this never happens but he comment and the code is a bit confusing)
For CLIENT_AUTH_NONE we should not receive Certificate message from client.
See tls 1.3:
The client MUST send a Certificate message if and only if the server
has requested client authentication via a CertificateRequest message
and tls 1.2:
This is the first message the client can send after receiving a
ServerHelloDone message. This message is only sent if the server
requests a certificate.
Probably should send a unexpected_message alert but this is probably elsewhere in the code ?
|
/integrate |
|
Going to push as commit fe78c0f.
Your commit was automatically rebased without conflicts. |
|
@johnshajiang Pushed as commit fe78c0f. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
If the server doesn't receive the client certificate for required client authentication, it should raise error
Empty client certificate chain.Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/17645/head:pull/17645$ git checkout pull/17645Update a local copy of the PR:
$ git checkout pull/17645$ git pull https://git.openjdk.org/jdk.git pull/17645/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 17645View PR using the GUI difftool:
$ git pr show -t 17645Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17645.diff
Webrev
Link to Webrev Comment