From b1fc2bcc14dae6c4e1d653d0b6b09010cadd8669 Mon Sep 17 00:00:00 2001 From: John Shaver Date: Sat, 16 Mar 2019 21:51:41 -0700 Subject: [PATCH] fix wildcard certificate verification --- app/index.html | 45 +++++++++++++++++++-------------------------- app/js/app.js | 24 ++++++++++++++---------- 2 files changed, 33 insertions(+), 36 deletions(-) diff --git a/app/index.html b/app/index.html index e345eee..421d727 100644 --- a/app/index.html +++ b/app/index.html @@ -168,6 +168,7 @@

Let's verify your domain

+
-

Upload this file

FILENAME
-
...loading
+
...loading

CONTENTS
-
...loading
+
...loading

To this location

-
..loading
+
..loading

Set this DNS Record

Hostname
-
loading...
+
loading...
TXT Host
-
loading...
+
loading...
TXT Value
-
loading...
+
loading...
+
+
-

Verify Wildcard Domains

- - - - - - - - - - - - - - - - -
HostnameTXT HostTXT Value
example.com_acme-challenge.example.com4A54
+
+

Set this DNS Record

+
Hostname
+
loading...
+
TXT Host
+
loading...
+
TXT Value
+
loading...
+
diff --git a/app/js/app.js b/app/js/app.js index f32ab86..e56e7a9 100644 --- a/app/js/app.js +++ b/app/js/app.js @@ -346,23 +346,27 @@ if (claim.wildcard) { obj.wildcard.push(data); + let verification = $qs(".js-acme-verification-wildcard"); + verification.querySelector(".js-acme-ver-hostname").innerHTML = data.hostname; + verification.querySelector(".js-acme-ver-txt-host").innerHTML = data.dnsHost; + verification.querySelector(".js-acme-ver-txt-value").innerHTML = data.dnsAnswer; - $qs(map.wildcard).innerHTML += '' + data.hostname + '' + data.dnsHost + '' + data.dnsAnswer + ''; } else if(obj[data.type]) { obj[data.type].push(data); if ('dns-01' === data.type) { - $qs("#js-acme-ver-hostname").innerHTML = data.hostname; - $qs("#js-acme-ver-txt-host").innerHTML = data.dnsHost; - $qs("#js-acme-ver-txt-value").innerHTML = data.dnsAnswer; + let verification = $qs(".js-acme-verification-dns-01"); + verification.querySelector(".js-acme-ver-hostname").innerHTML = data.hostname; + verification.querySelector(".js-acme-ver-txt-host").innerHTML = data.dnsHost; + verification.querySelector(".js-acme-ver-txt-value").innerHTML = data.dnsAnswer; } else if ('http-01' === data.type) { - $qs("#js-acme-ver-file-location").innerHTML = data.httpPath.split("/").slice(-1); - $qs("#js-acme-ver-content").innerHTML = data.httpAuth; - $qs("#js-acme-ver-uri").innerHTML = data.httpPath; - $qs("#js-download-verify-link").href = + $qs(".js-acme-ver-file-location").innerHTML = data.httpPath.split("/").slice(-1); + $qs(".js-acme-ver-content").innerHTML = data.httpAuth; + $qs(".js-acme-ver-uri").innerHTML = data.httpPath; + $qs(".js-download-verify-link").href = "data:text/octet-stream;base64," + window.btoa(data.httpAuth); - $qs("#js-download-verify-link").download = data.httpPath.split("/").slice(-1); + $qs(".js-download-verify-link").download = data.httpPath.split("/").slice(-1); } } @@ -374,7 +378,7 @@ // hide wildcard if no wildcard // hide http-01 and dns-01 if only wildcard if (!obj.wildcard.length) { - $qs('.js-acme-wildcard').hidden = true; + $qs('.js-acme-wildcard-challenges').hidden = true; } if (!obj['http-01'].length) { $qs('.js-acme-challenges').hidden = true;