diff --git a/setting.py b/setting.py index 07e0e3e62..eac374df0 100755 --- a/setting.py +++ b/setting.py @@ -63,10 +63,13 @@ ssl_choose_file = 'ssl/choose.pl' if os.path.exists(ssl_choose_file): ssl_choose = mw.readFile(ssl_choose_file).strip() if mw.inArray(['local','nginx'],ssl_choose): - certfile = 'ssl/'+ssl_choose+'/cert.pem' - keyfile = 'ssl/'+ssl_choose+'/private.pem' - ciphers = 'TLSv1 TLSv1.1 TLSv1.2 TLSv1.3' - ssl_version = 2 + tmp_cert = 'ssl/'+ssl_choose+'/cert.pem' + tmp_private = 'ssl/'+ssl_choose+'/private.pem' + if os.path.exists(tmp_cert) and os.path.exists(tmp_private): + certfile = tmp_cert + keyfile = tmp_private + ciphers = 'TLSv1 TLSv1.1 TLSv1.2 TLSv1.3' + ssl_version = 2 # 初始安装时,自动生成安全路径 if not os.path.exists('data/admin_path.pl'):