Skip to content

feat: support client certificate verification#4034

Merged
spacewander merged 3 commits intoapache:masterfrom
spacewander:cca
Apr 22, 2021
Merged

feat: support client certificate verification#4034
spacewander merged 3 commits intoapache:masterfrom
spacewander:cca

Conversation

@spacewander
Copy link
Copy Markdown
Member

Signed-off-by: spacewander spacewanderlzx@gmail.com

What this PR does / why we need it:

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
@spacewander spacewander marked this pull request as ready for review April 12, 2021 13:05
@spacewander spacewander requested a review from membphis April 12, 2021 13:07
end

if matched_ssl.value.client then
local client_cert = matched_ssl.value.client.ca
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name client_cert is confusing, actually, it's the CA cert(s) to verify the client cert. What about ca_cert.

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
Comment on lines +787 to +788
| client.ca | False | Certificate| set the CA certificate which will use to verify client. This feature requires OpenResty 1.19+. | |
| client.depth | False | Certificate| set the verification depth in the client certificates chain, default to 1. This feature requires OpenResty 1.19+. | |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first letter should be capitalized. set --> Set

set the CA certificate which will use to verify client.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of the description in this table start with uppercase letter.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it.

Comment on lines +208 to +210
local ssl_ca_cert = t.read_file("t/certs/mtls_ca.crt")
local ssl_cert = t.read_file("t/certs/mtls_client.crt")
local ssl_key = t.read_file("t/certs/mtls_client.key")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These certificates were not used in this test, I think they can be removed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Firstsawyou
Updated.

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
@spacewander spacewander merged commit 544ab52 into apache:master Apr 22, 2021
@spacewander spacewander deleted the cca branch April 22, 2021 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants