From 459eb55896582a748e08e71aabcaae6d8e383cbc Mon Sep 17 00:00:00 2001 From: heuri Date: Thu, 10 Jun 2021 08:33:34 +0200 Subject: [PATCH] Forces the domain to be lowercase Fixes problems with non lower case SNI requests - e.g. https://LuA-ReStY-AuTo-SsL.TlD --- lib/resty/auto-ssl/ssl_certificate.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/resty/auto-ssl/ssl_certificate.lua b/lib/resty/auto-ssl/ssl_certificate.lua index ab71cfd..f342d37 100644 --- a/lib/resty/auto-ssl/ssl_certificate.lua +++ b/lib/resty/auto-ssl/ssl_certificate.lua @@ -281,6 +281,9 @@ local function do_ssl(auto_ssl_instance, ssl_options) ngx.log(ngx.WARN, "auto-ssl: could not determine domain for request (SNI not supported?) - using fallback - " .. (domain_err or "")) return end + + -- Forces the domain to be lowercase + domain = domain:lower() -- Get or issue the certificate for this domain. local cert_der, get_cert_der_err = get_cert_der(auto_ssl_instance, domain, ssl_options)