Save OpenSSL rand file in data directory to avoid error message on Windows
This commit is contained in:
parent
b814a633c6
commit
bad4d14cf6
2 changed files with 6 additions and 3 deletions
|
@ -16,7 +16,10 @@ class CryptConnectionManager:
|
|||
self.openssl_bin = "dist\\openssl\\openssl.exe"
|
||||
else:
|
||||
self.openssl_bin = "openssl"
|
||||
self.openssl_env = {"OPENSSL_CONF": "src/lib/openssl/openssl.cnf"}
|
||||
self.openssl_env = {
|
||||
"OPENSSL_CONF": "src/lib/openssl/openssl.cnf",
|
||||
"RANDFILE": config.data_dir + "/openssl-rand.tmp"
|
||||
}
|
||||
|
||||
self.crypt_supported = [] # Supported cryptos
|
||||
|
||||
|
@ -57,7 +60,7 @@ class CryptConnectionManager:
|
|||
def removeCerts(self):
|
||||
if config.keep_ssl_cert:
|
||||
return False
|
||||
for file_name in ["cert-rsa.pem", "key-rsa.pem", "cacert-rsa.pem", "cakey-rsa.pem", "cacert-rsa.srl", "cert-rsa.csr"]:
|
||||
for file_name in ["cert-rsa.pem", "key-rsa.pem", "cacert-rsa.pem", "cakey-rsa.pem", "cacert-rsa.srl", "cert-rsa.csr", "openssl-rand.tmp"]:
|
||||
file_path = "%s/%s" % (config.data_dir, file_name)
|
||||
if os.path.isfile(file_path):
|
||||
os.unlink(file_path)
|
||||
|
|
|
@ -107,7 +107,7 @@ def cleanup():
|
|||
for dir_path in [config.data_dir, config.data_dir + "-temp"]:
|
||||
for file_name in os.listdir(dir_path):
|
||||
ext = file_name.rsplit(".", 1)[-1]
|
||||
if ext not in ["csr", "pem", "srl", "db", "json"]:
|
||||
if ext not in ["csr", "pem", "srl", "db", "json", "tmp"]:
|
||||
continue
|
||||
file_path = dir_path + "/" + file_name
|
||||
if os.path.isfile(file_path):
|
||||
|
|
Loading…
Reference in a new issue