Explorar o código

Fix HTTP01 challenge url when --acme-http-host is used

This commit fixes an issue whith the HTTP-01 challenge URL not having
the insecure port.
Mariano Cano %!s(int64=2) %!d(string=hai) anos
pai
achega
8ac876df3a
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      acme/challenge.go

+ 3 - 1
acme/challenge.go

@@ -117,7 +117,9 @@ func http01Validate(ctx context.Context, ch *Challenge, db DB, jwk *jose.JSONWeb
 	// Append insecure port if set.
 	// Append insecure port if set.
 	// Only used for testing purposes.
 	// Only used for testing purposes.
 	if InsecurePortHTTP01 != 0 {
 	if InsecurePortHTTP01 != 0 {
-		u.Host += ":" + strconv.Itoa(InsecurePortHTTP01)
+		insecurePort := strconv.Itoa(InsecurePortHTTP01)
+		u.Host += ":" + insecurePort
+		challengeURL.Host += ":" + insecurePort
 	}
 	}
 
 
 	vc := MustClientFromContext(ctx)
 	vc := MustClientFromContext(ctx)