-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Add dynamic certificate serving feature to controller #2923
Add dynamic certificate serving feature to controller #2923
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2923 +/- ##
==========================================
- Coverage 47.58% 47.56% -0.02%
==========================================
Files 77 77
Lines 5533 5632 +99
==========================================
+ Hits 2633 2679 +46
- Misses 2560 2600 +40
- Partials 340 353 +13
Continue to review full report at Codecov.
|
@hnrytrn my only question is related to OCSP. From the ssl.md link I see this https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/ocsp.md Edit: this can be done in a different PR |
/hold |
/lgtm |
@aledbf Hi, yes I was planning on adding OCSP functionality using Open Resty's OCSP module in the next iteration of this feature. |
if !n.IsDynamicConfigurationEnough(newConfig) { | ||
t.Errorf("Expected to be dynamically configurable when backend and SSLCert changes") | ||
} | ||
|
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.
can you also add a test when dynamic certificate configuration is enabled and a server in new configuration has a change other than certificate.
} | ||
|
||
if strings.Index(body, "service") != -1 { | ||
t.Errorf("unexpected service reference in JSON content: %v", body) |
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.
Why do you have these two assertions?
c := certutil.EncodeCertPEM(cert.Cert) | ||
k := certutil.EncodePrivateKeyPEM(cert.Key) | ||
|
||
ngxCert, err := CreateSSLCert(name, c, k, []byte{}) |
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 don't see how are you asserting that c
and k
are properly formatted and bundled into ngxCert
, am I missing something?
/hold cancel |
c358afd
to
566ffd3
Compare
566ffd3
to
d081687
Compare
d081687
to
7faf089
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aledbf, ElvinEfendi, hnrytrn The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
This PR is a part of adding dynamic certificate serving functionality. It adds a new flag
enable-dynamic-certificates
. When enabled, the controller will POST certificates to a Lua endpoint (#2889), avoid reloading NGINX when certificates are updated, and avoid writing certificates on disk. There will be another PR following this to serve the certificates that are POSTed.Special notes for your reviewer:
This feature currently does not support OCSP because the future PR that will serve the certificates will use Open Resty's ngx.ssl module (https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/ssl.md), which does not support OCSP.