Files
labca/patches/va_http.patch
2024-07-02 19:47:47 +02:00

23 lines
715 B
Diff

diff --git a/va/http.go b/va/http.go
index 5eefabcb4..0188d4005 100644
--- a/va/http.go
+++ b/va/http.go
@@ -326,7 +326,16 @@ func (va *ValidationAuthorityImpl) extractRequestTarget(req *http.Request) (stri
}
if _, err := iana.ExtractSuffix(reqHost); err != nil {
- return "", 0, berrors.ConnectionFailureError("Invalid hostname in redirect target, must end in IANA registered TLD")
+ isLabca := false
+ for _, domain := range va.labcaDomains {
+ if strings.HasSuffix(reqHost, "."+domain) {
+ isLabca = true
+ }
+ }
+
+ if !isLabca {
+ return "", 0, berrors.ConnectionFailureError("Invalid hostname in redirect target, must end in IANA registered TLD")
+ }
}
return reqHost, reqPort, nil