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
70 stars 11 forks source link

Validate Hostnames + Misc Fixes #24

Closed zsteinkamp closed 1 year ago

zsteinkamp commented 1 year ago

Proposed changes

A bad hostname will cause the following log output:

njs-acme-nginx-1   | 2023/07/18 18:33:43 [error] 42#42: *1 js: njs-acme: [utils] Invalid hostname(s) in `njs_acme_server_names` detected: *.nginx.com
njs-acme-nginx-1   | 2023/07/18 18:33:43 [error] 42#42: *1 js exception: Error: unhandled promise rejection: Error: Invalid hostname(s) in `njs_acme_server_names` detected: *.nginx.com, client: 172.24.0.1, server: proxy.nginx.com, request: "GET /acme/auto HTTP/1.1", host: "localhost:8000"
njs-acme-nginx-1   | 172.24.0.1 - - [18/Jul/2023:18:33:43 +0000] "GET /acme/auto HTTP/1.1" 500 177 "-" "curl/7.88.1"

Checklist

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

zsteinkamp commented 1 year ago

Rebased against origin/main and updated the commit comment to be conventional.