Ensure the openssl and cryptography work under python3. (#438)
This commit is contained in:
@ -51,7 +51,7 @@ def build_root_certificate(options):
|
||||
|
||||
cert_pem = cert.public_bytes(
|
||||
encoding=serialization.Encoding.PEM
|
||||
)
|
||||
).decode('utf-8')
|
||||
|
||||
private_key_pem = private_key.private_bytes(
|
||||
encoding=serialization.Encoding.PEM,
|
||||
@ -82,7 +82,7 @@ def issue_certificate(csr, options):
|
||||
builder = builder.serial_number(int(uuid.uuid4()))
|
||||
|
||||
private_key = serialization.load_pem_private_key(
|
||||
options['authority'].authority_certificate.private_key,
|
||||
bytes(options['authority'].authority_certificate.private_key, 'utf-8'),
|
||||
password=None,
|
||||
backend=default_backend()
|
||||
)
|
||||
@ -91,7 +91,7 @@ def issue_certificate(csr, options):
|
||||
|
||||
return cert.public_bytes(
|
||||
encoding=serialization.Encoding.PEM
|
||||
)
|
||||
).decode('utf-8')
|
||||
|
||||
|
||||
class CryptographyIssuerPlugin(IssuerPlugin):
|
||||
|
@ -60,7 +60,10 @@ def create_pkcs12(cert, chain, p12_tmp, key, alias, passphrase):
|
||||
# Create PKCS12 keystore from private key and public certificate
|
||||
with mktempfile() as cert_tmp:
|
||||
with open(cert_tmp, 'w') as f:
|
||||
f.writelines([cert.strip() + "\n", chain.strip() + "\n"])
|
||||
if chain:
|
||||
f.writelines([cert.strip() + "\n", chain.strip() + "\n"])
|
||||
else:
|
||||
f.writelines([cert.strip() + "\n"])
|
||||
|
||||
run_process([
|
||||
"openssl",
|
||||
|
Reference in New Issue
Block a user