-
Notifications
You must be signed in to change notification settings - Fork 171
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
Policy: MTLS with trusted store and verify #1280
Conversation
eloycoto
commented
Jun 16, 2021
For some reason I had issues when using ffi.metatypes to interact with the ffi interface. With this change,the store will not use ffi.metatype and it'll send the object natively to the ffi functions. Other option was to use self.cdata, but it's not clear at all, and this makes more sense. Inspired in the work made by https://github.com/fffonion/lua-resty-openssl Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
094ad1f
to
67e8cd5
Compare
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 just added minor comments. I'm not really familiar with this part of the codebase and can't help as much as I'd like, but it looks good to me 👍
valid = true | ||
store:add_cert(cert) | ||
else | ||
ngx.log(ngx.INFO, "cannot load certificate, err: ", err) |
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.
Different indentation.
end | ||
|
||
store = nil | ||
return |
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.
Unnecessary return
|
||
it("ca_store is nil if no certificates", function() | ||
local config = { | ||
certificate = "XXXX", |
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.
You could extract this string to a variable accessible from all the tests and reuse it everywhere.
When using upstream_mtls policy, the policy only sends the client certificates but does not verify the connection. Therefore, the policy name is not honouring what it did. A new x509_store will be created with this change, and it'll be used to verify the SSL_context. This change will use some FFI functions that are part of apicast-nginx-module[0] Fix THREESCALE-7099 [0] https://github.com/3scale/apicast-nginx-module Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
67e8cd5
to
5121c97
Compare