ensure kind "acme-tls-alpn-01" is registered on the http handler

previous code couldn't possibly be triggered by my reading.

encountered during PR #255
This commit is contained in:
Mechiel Lukkien 2025-01-13 10:43:55 +01:00
parent eb88e2651a
commit b8bf99e082
No known key found for this signature in database

View File

@ -596,12 +596,13 @@ func portServes(l config.Listener) map[int]*serve {
if https && l.TLS.ACME != "" { if https && l.TLS.ACME != "" {
s.TLSConfig = l.TLS.ACMEConfig s.TLSConfig = l.TLS.ACMEConfig
} else if https {
s.TLSConfig = l.TLS.Config tlsport := config.Port(mox.Conf.Static.ACME[l.TLS.ACME].Port, 443)
if l.TLS.ACME != "" { if portServe[tlsport] == nil || !slices.Contains(portServe[tlsport].Kinds, "acme-tls-alpn-01") {
tlsport := config.Port(mox.Conf.Static.ACME[l.TLS.ACME].Port, 443)
ensureServe(true, tlsport, "acme-tls-alpn-01", false) ensureServe(true, tlsport, "acme-tls-alpn-01", false)
} }
} else if https {
s.TLSConfig = l.TLS.Config
} }
return s return s
} }