Kaynağa Gözat

Simplify trimming *. prefix of domain in acme dns validation.

max furman 7 yıl önce
ebeveyn
işleme
967e86a48b
1 değiştirilmiş dosya ile 1 ekleme ve 4 silme
  1. 1 4
      acme/challenge.go

+ 1 - 4
acme/challenge.go

@@ -389,10 +389,7 @@ func (dc *dns01Challenge) validate(db nosql.DB, jwk *jose.JSONWebKey, vo validat
 	// This is done to avoid making TXT lookups for domains like
 	// This is done to avoid making TXT lookups for domains like
 	// _acme-challenge.*.example.com
 	// _acme-challenge.*.example.com
 	// Instead perform txt lookup for _acme-challenge.example.com
 	// Instead perform txt lookup for _acme-challenge.example.com
-	domain := dc.Value
-	if strings.HasPrefix(domain, "*") {
-		domain = strings.TrimPrefix(domain, "*.")
-	}
+	domain := strings.TrimPrefix(dc.Value, "*.")
 
 
 	txtRecords, err := vo.lookupTxt("_acme-challenge." + domain)
 	txtRecords, err := vo.lookupTxt("_acme-challenge." + domain)
 	if err != nil {
 	if err != nil {