diff options
author | Mike Crute <mike@crute.us> | 2022-12-24 08:36:42 -0800 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2022-12-24 08:36:42 -0800 |
commit | d2d1be152822d4006855d1b692785c6d7f3d6d5d (patch) | |
tree | 46a8fd7c3ca1ccba238203dfe0af2770903b309a /web | |
parent | c18aef9f0aa2d9ed7238a0f1ce0a7d82c5800389 (diff) | |
download | go_ddns_manager-d2d1be152822d4006855d1b692785c6d7f3d6d5d.tar.bz2 go_ddns_manager-d2d1be152822d4006855d1b692785c6d7f3d6d5d.tar.xz go_ddns_manager-d2d1be152822d4006855d1b692785c6d7f3d6d5d.zip |
Fixes for ACMEv2
Diffstat (limited to 'web')
-rw-r--r-- | web/controllers/acmev2.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/web/controllers/acmev2.go b/web/controllers/acmev2.go index a2fadf5..7ea76af 100644 --- a/web/controllers/acmev2.go +++ b/web/controllers/acmev2.go | |||
@@ -42,16 +42,21 @@ func CreateAcmeChallengeV2(c *gin.Context) { | |||
42 | return | 42 | return |
43 | } | 43 | } |
44 | 44 | ||
45 | testFor := fmt.Sprintf("_acme-challenge.%s.%s", prefix, zone.Name) | ||
46 | if prefix == "" { | ||
47 | testFor = fmt.Sprintf("_acme-challenge.%s", zone.Name) | ||
48 | } | ||
49 | |||
45 | if err := cfg.DNSClient.WaitForDNSPropagation( | 50 | if err := cfg.DNSClient.WaitForDNSPropagation( |
46 | c.Request.Context(), | 51 | c.Request.Context(), |
47 | fmt.Sprintf("_acme-challenge.%s.", prefix), | 52 | testFor, |
48 | ch.Challenge, | 53 | ch.Challenge, |
49 | ); err != nil { | 54 | ); err != nil { |
50 | jsonError(c, http.StatusInternalServerError, fmt.Errorf("Error polling for DNS propagation: %w", err)) | 55 | jsonError(c, http.StatusInternalServerError, fmt.Errorf("Error polling for DNS propagation: %w", err)) |
51 | return | 56 | return |
52 | } | 57 | } |
53 | 58 | ||
54 | c.JSON(http.StatusCreated, "") | 59 | c.String(http.StatusCreated, "") |
55 | } | 60 | } |
56 | 61 | ||
57 | func DeleteAcmeChallengeV2(c *gin.Context) { | 62 | func DeleteAcmeChallengeV2(c *gin.Context) { |