pull/393/head
midoks 2 years ago
parent faa95b0d88
commit 00c9157f9b
  1. 12
      class/core/config_api.py
  2. 2
      route/static/app/config.js

@ -351,12 +351,24 @@ class config_api:
# 不再自动生成证书
# mw.createSSL()
cert['privateKey'] = ''
cert['is_https'] = ''
cert['certPem'] = ''
cert['rep'] = os.path.exists('ssl/input.pl')
cert['info'] = {'endtime': 0, 'subject': '',
'notAfter': '', 'notBefore': '', 'issuer': ''}
return cert
if conf.find('$server_port !~ 443') != -1:
return True
panel_ssl = mw.getServerDir() + "/web_conf/nginx/vhost/panel.conf"
if not os.exists.exists(panel_ssl):
cert['is_https'] = ''
else:
ssl_data = mw.readFile(panel_ssl)
if ssl_data.find('$server_port !~ 443') != -1:
cert['is_https'] = 'checked'
cert['privateKey'] = mw.readFile(keyPath)
cert['certPem'] = mw.readFile(certPath)
cert['rep'] = os.path.exists('ssl/input.pl')

@ -447,7 +447,7 @@ function getPanelSSL(){
<div class='state_item'>\
<span>强制HTTPS</span>\
<span class='switch'>\
<input class='btswitch btswitch-ios' id='toHttps' type='checkbox'>\
<input class='btswitch btswitch-ios' id='toHttps' type='checkbox' "+cert['info']['is_https']+">\
<label class='btswitch-btn set_panel_http_to_https' for='toHttps'></label>\
</span>\
</div>\

Loading…
Cancel
Save