|
@@ -72,7 +72,13 @@
|
|
|
<label>Use TLS to serve proxy request</label>
|
|
|
</div>
|
|
|
<br>
|
|
|
- <div id="redirect" class="ui toggle notloopbackOnly checkbox" style="margin-top: 0.6em;">
|
|
|
+ <div id="tlsMinVer" class="ui toggle notloopbackOnly tlsEnabledOnly checkbox" style="margin-top: 0.6em;">
|
|
|
+ <input type="checkbox">
|
|
|
+ <label>Force TLS v1.2 or above<br>
|
|
|
+ <small>(Not compatible with legacy browsers)</small></label>
|
|
|
+ </div>
|
|
|
+ <br>
|
|
|
+ <div id="redirect" class="ui toggle notloopbackOnly tlsEnabledOnly checkbox" style="margin-top: 0.6em;">
|
|
|
<input type="checkbox">
|
|
|
<label>Force redirect HTTP request to HTTPS<br>
|
|
|
<small>(Only apply when listening port is not 80)</small></label>
|
|
@@ -340,21 +346,50 @@
|
|
|
}
|
|
|
initHTTPtoHTTPSRedirectSetting();
|
|
|
|
|
|
+ function initTlsVersionSetting(){
|
|
|
+ $.get("/api/cert/tlsRequireLatest", function(data){
|
|
|
+ if (data == true){
|
|
|
+ $("#tlsMinVer").checkbox("set checked");
|
|
|
+ }else{
|
|
|
+ $("#tlsMinVer").checkbox("set unchecked");
|
|
|
+ }
|
|
|
+
|
|
|
+ //Bind events to the checkbox
|
|
|
+ $("#tlsMinVer").find("input").on("change", function(){
|
|
|
+ let thisValue = $("#tlsMinVer").checkbox("is checked");
|
|
|
+ $.ajax({
|
|
|
+ url: "/api/cert/tlsRequireLatest",
|
|
|
+ data: {"set": thisValue},
|
|
|
+ success: function(data){
|
|
|
+ if (data.error != undefined){
|
|
|
+ msgbox(data.error, false, 5000);
|
|
|
+ }else{
|
|
|
+ msgbox("TLS Version Setting Updated");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+ initTlsVersionSetting();
|
|
|
+
|
|
|
function initTlsSetting(){
|
|
|
$.get("/api/cert/tls", function(data){
|
|
|
if (data == true){
|
|
|
$("#tls").checkbox("set checked");
|
|
|
}else{
|
|
|
- $("#redirect").addClass('disabled');
|
|
|
+ $(".tlsEnabledOnly").addClass('disabled');
|
|
|
+ $(".tlsEnabledOnly").addClass('disabled');
|
|
|
}
|
|
|
|
|
|
//Initiate the input listener on the checkbox
|
|
|
$("#tls").find("input").on("change", function(){
|
|
|
let thisValue = $("#tls").checkbox("is checked");
|
|
|
if (thisValue){
|
|
|
- $("#redirect").removeClass('disabled');
|
|
|
+ $(".tlsEnabledOnly").removeClass('disabled');
|
|
|
}else{
|
|
|
- $("#redirect").addClass('disabled');
|
|
|
+ $(".tlsEnabledOnly").addClass('disabled');
|
|
|
}
|
|
|
$.ajax({
|
|
|
url: "/api/cert/tls",
|