nginx / njs-acme

Nginx NJS module runtime to work with ACME providers like Let's Encrypt for automated no-reload TLS certificate issue/renewal.
Apache License 2.0
57 stars 9 forks source link

Implements #23 - Ensure if servername config changes that certs are updated #26

Closed zsteinkamp closed 1 year ago

zsteinkamp commented 1 year ago

Proposed changes

Recognize if njs_acme_server_names no longer matches the stored certificate. If so, request a new cert with the configured names.

Also includes a handful of small changes for DRYing up (e.g. adds acmeCommonName(r) and acmeAltNames(r) methods), defines some more specific types, renames some variables/methods to be more accurate. Adds a second server name to the example config to demonstrate this clearly.

These changes ended up making the PR bigger than I expected. Happy to remove the changes to make this one lean.

TODO: Add unit tests when #24 is merged (contains unit test framework improvements).

Checklist

Before creating a PR, run through this checklist and mark each as complete.