Fix hsts enable disable
This commit is contained in:
@@ -146,8 +146,7 @@ class SSL:
|
|||||||
self, "Adding /var/www/{0}/conf/nginx/hsts.conf"
|
self, "Adding /var/www/{0}/conf/nginx/hsts.conf"
|
||||||
.format(wo_domain_name))
|
.format(wo_domain_name))
|
||||||
|
|
||||||
hstsconf = open("/var/www/{0}/conf/nginx/hsts.conf"
|
hstsconf = open(f"/var/www/{wo_domain_name}/conf/nginx/hsts.conf",
|
||||||
.format(wo_domain_name),
|
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
hstsconf.write("more_set_headers "
|
hstsconf.write("more_set_headers "
|
||||||
"\"Strict-Transport-Security: "
|
"\"Strict-Transport-Security: "
|
||||||
@@ -177,13 +176,11 @@ class SSL:
|
|||||||
try:
|
try:
|
||||||
WOShellExec.cmd_exec(
|
WOShellExec.cmd_exec(
|
||||||
self, "openssl genrsa -out "
|
self, "openssl genrsa -out "
|
||||||
"{0}/ssl.key 2048"
|
f"{selfs_tmp}/ssl.key 2048")
|
||||||
.format(selfs_tmp))
|
|
||||||
WOShellExec.cmd_exec(
|
WOShellExec.cmd_exec(
|
||||||
self, "openssl req -new -batch "
|
self, "openssl req -new -batch "
|
||||||
"-subj /commonName=localhost/ "
|
"-subj /commonName=localhost/ "
|
||||||
"-key {0}/ssl.key -out {0}/ssl.csr"
|
f"-key {selfs_tmp}/ssl.key -out {selfs_tmp}/ssl.csr")
|
||||||
.format(selfs_tmp))
|
|
||||||
|
|
||||||
WOFileUtils.mvfile(
|
WOFileUtils.mvfile(
|
||||||
self, "{0}/ssl.key"
|
self, "{0}/ssl.key"
|
||||||
|
|||||||
Reference in New Issue
Block a user