Fix UnicodeDecodeError when OpenSSL is not found

Fixes #2180
This commit is contained in:
Ivanq 2019-09-02 14:35:28 +00:00 committed by GitHub
parent 149c4f5c7b
commit 500c96abe2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -137,14 +137,14 @@ class CryptConnectionManager:
cmd, shell=True, stderr=subprocess.STDOUT,
stdout=subprocess.PIPE, env=self.openssl_env
)
back = proc.stdout.read().strip().decode().replace("\r", "")
back = proc.stdout.read().strip().replace(b"\r", b"")
proc.wait()
if not (os.path.isfile(self.cacert_pem) and os.path.isfile(self.cakey_pem)):
self.log.error("RSA ECC SSL CAcert generation failed, CAcert or CAkey files not exist. (%s)" % back)
return False
else:
self.log.debug("Result: %s" % back)
self.log.debug("Result: %s" % back.decode())
# Generate certificate key and signing request
cmd_params = helper.shellquote(