-
Notifications
You must be signed in to change notification settings - Fork 41
Support mTLS #222
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
base: master
Are you sure you want to change the base?
Support mTLS #222
Conversation
By default server checked server and client certificates which should do with mTLS configuration. Since it is not expected behaviour, after the patch `ca_file` configuration won't ask for client certificates authorization Closes #217
7fed070 to
b5f1cf3
Compare
DifferentialOrange
left a comment
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.
Let's wait for the default option feedback
| local VERIFY_CLIENT_OPTS = { | ||
| off = sslsocket.SET_VERIFY_FLAGS.SSL_VERIFY_NONE, | ||
| optional = sslsocket.SET_VERIFY_FLAGS.SSL_VERIFY_PEER, | ||
| on = sslsocket.SET_VERIFY_FLAGS.SSL_VERIFY_PEER + sslsocket.SET_VERIFY_FLAGS.SSL_VERIFY_FAIL_IF_NO_PEER, | ||
| } |
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.
Let's reference NGINX in the commit message as a motivation (if we actually use the same names and defaults)
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.
Added
http/server.lua
Outdated
| local VERIFY_CLIENT_OPTS = { | ||
| off = sslsocket.SET_VERIFY_FLAGS.SSL_VERIFY_NONE, | ||
| optional = sslsocket.SET_VERIFY_FLAGS.SSL_VERIFY_PEER, | ||
| on = sslsocket.SET_VERIFY_FLAGS.SSL_VERIFY_PEER + sslsocket.SET_VERIFY_FLAGS.SSL_VERIFY_FAIL_IF_NO_PEER, |
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.
Does some bit operation is actually expected to be here? There is a proper bit library for it.
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.
Used bit lib
| }, | ||
| test_verify_client_optional_with_certs_valid = { | ||
| ssl_opts = { | ||
| ssl_verify_client = "optional", |
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.
| ssl_verify_client = "optional", | |
| ssl_verify_client = 'optional', |
etc
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.
Corrected
CHANGELOG.md
Outdated
|
|
||
| - Do not recreate server if it's address and port were not changed (#219). | ||
| - Server doesn't change after updating parameters on config reload (#216). | ||
| - Mutual TLS with `ca_file` option enabled (#217). |
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.
| - Mutual TLS with `ca_file` option enabled (#217). | |
| - **Breaking change**: mutual TLS with `ca_file` option enabled (#217). |
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.
Fixed
This patch allows to set a new `ssl_verify_client` option. It uses in pair with `ssl_ca_file` option and needs for client validation. It could have following values: * `off` (default one) means that no client's certs will be verified; * `on` means that server will verify client's certs; * `optional` means that server will verify client's certs only if it exist. This set of options was was built on top of the NGINX API (https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_verify_client). In effect, this option forces the server to work with mutual TLS. Part of #207
Since http server supports a new `ssl_verify_client` option it is necessary to support it in role api as well. This patch introduces a new config parameter in httpd role with the same `ssl_verify_client` name. Closes #207
b5f1cf3 to
0736446
Compare
This patch allows to set a new
ssl_verify_clientoption. It uses in pair withssl_ca_fileoption and needs for client validation. It could have following values:off(default one) means that no client's certs will be verified;onmeans that server will verify client's certs;optionalmeans that server will verify client's certs only if it exist.In effect, this option forces the server to work with mutual TLS.
The same parameter was supported for httpd role as well.
Closes #207
Closes #217