diff --git a/class/core/config_api.py b/class/core/config_api.py index f485415b0..496f1d7ae 100755 --- a/class/core/config_api.py +++ b/class/core/config_api.py @@ -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') diff --git a/route/static/app/config.js b/route/static/app/config.js index cdfd745de..11806551d 100755 --- a/route/static/app/config.js +++ b/route/static/app/config.js @@ -447,7 +447,7 @@ function getPanelSSL(){