Просмотр исходного кода

Merge pull request #1919 from smallstep/mariano/fix-acme-http-port

Fix HTTP01 challenge url when --acme-http-host is used
Mariano Cano 2 лет назад
Родитель
Сommit
e28eae7872
1 измененных файлов с 3 добавлено и 1 удалено
  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.
 	// Only used for testing purposes.
 	if InsecurePortHTTP01 != 0 {
-		u.Host += ":" + strconv.Itoa(InsecurePortHTTP01)
+		insecurePort := strconv.Itoa(InsecurePortHTTP01)
+		u.Host += ":" + insecurePort
+		challengeURL.Host += ":" + insecurePort
 	}
 
 	vc := MustClientFromContext(ctx)