From 6b5e5ecb47a27c68c8ab511c1067e02e6599e222 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Mon, 3 Jun 2024 00:56:23 +0200 Subject: [PATCH] Fix hsts enable disable --- wo/core/sslutils.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/wo/core/sslutils.py b/wo/core/sslutils.py index ef167e4..5c6ded5 100644 --- a/wo/core/sslutils.py +++ b/wo/core/sslutils.py @@ -146,8 +146,7 @@ class SSL: self, "Adding /var/www/{0}/conf/nginx/hsts.conf" .format(wo_domain_name)) - hstsconf = open("/var/www/{0}/conf/nginx/hsts.conf" - .format(wo_domain_name), + hstsconf = open(f"/var/www/{wo_domain_name}/conf/nginx/hsts.conf", encoding='utf-8', mode='w') hstsconf.write("more_set_headers " "\"Strict-Transport-Security: " @@ -177,13 +176,11 @@ class SSL: try: WOShellExec.cmd_exec( self, "openssl genrsa -out " - "{0}/ssl.key 2048" - .format(selfs_tmp)) + f"{selfs_tmp}/ssl.key 2048") WOShellExec.cmd_exec( self, "openssl req -new -batch " "-subj /commonName=localhost/ " - "-key {0}/ssl.key -out {0}/ssl.csr" - .format(selfs_tmp)) + f"-key {selfs_tmp}/ssl.key -out {selfs_tmp}/ssl.csr") WOFileUtils.mvfile( self, "{0}/ssl.key"