Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 81dd4d0

Browse files
committed
Fix Let's Encrypt http-01 challenge
I'm puzzled how this ever worked: Let's Encrypt http-01 challenges work by hitting the webserver on HTTP to request a validation file. Scan (somehow) used to be able to generate the cert without this validation step happening, but that's stopped working. This change adds the autocert handler into Chi's middleware list such that if, on plain HTTP a Let's Encrypt challenge comes in, it's handled properly to allow cert generation.
1 parent ee1a1c9 commit 81dd4d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scan.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ func main() {
804804
if *tlsHostname != "" {
805805
m.HostPolicy = autocert.HostWhitelist(*tlsHostname)
806806
}
807-
middlewares = append(middlewares, redirectHTTPS)
807+
middlewares = append(middlewares, m.HTTPHandler, redirectHTTPS)
808808
}
809809

810810
r := setupRouter(middlewares...)

0 commit comments

Comments
 (0)