Merge pull request #57 from daluntw/dev-custom-acme

Add Skip TLS Verify Feature For ACME Server
This commit is contained in:
Toby Chui
2023-08-29 10:06:52 +08:00
committed by GitHub
3 changed files with 53 additions and 11 deletions

View File

@@ -114,9 +114,15 @@
</div>
</div>
</div>
<div class="field" id="customca" style="display:none;">
<div class="field" id="caInput" style="display:none;">
<label>ACME Server URL</label>
<input id="caurl" type="text" placeholder="https://example.com/acme/dictionary">
<input id="caURL" type="text" placeholder="https://example.com/acme/dictionary">
</div>
<div class="field" id="skipTLS" style="display:none;">
<div class="ui checkbox">
<input type="checkbox" id="skipTLSCheckbox">
<label>Ignore TLS/SSL Verification Error<br><small>E.g. self-signed, expired certificate (Not Recommended)</small></label>
</div>
</div>
<button id="obtainButton" class="ui basic button" type="submit"><i class="yellow refresh icon"></i> Renew Certificate</button>
</div>
@@ -302,9 +308,11 @@
$("input[name=ca]").on('change', function() {
if(this.value == "Custom ACME Server") {
$("#customca").show();
$("#caInput").show();
$("#skipTLS").show();
} else {
$("#customca").hide();
$("#caInput").hide();
$("#skipTLS").hide();
}
})
@@ -331,12 +339,14 @@
}
var ca = $("#ca").dropdown("get value");
var ca_url = "";
var caURL = "";
if (ca == "Custom ACME Server") {
ca = "custom";
ca_url = $("#caurl").val();
caURL = $("#caURL").val();
}
var skipTLSValue = $("#skipTLSCheckbox")[0].checked;
$.ajax({
url: "/api/acme/obtainCert",
method: "GET",
@@ -345,7 +355,8 @@
filename: filename,
email: email,
ca: ca,
ca_url: ca_url,
caURL: caURL,
skipTLS: skipTLSValue,
},
success: function(response) {
$("#obtainButton").removeClass("loading").removeClass("disabled");