Ensure the openssl and cryptography work under python3. (#438)
This commit is contained in:
parent
a19c918c68
commit
72a390c563
|
@ -887,7 +887,7 @@ class CertificateExport(AuthenticatedResource):
|
|||
extension, passphrase, data = plugin.export(cert.body, cert.chain, cert.private_key, options)
|
||||
|
||||
# we take a hit in message size when b64 encoding
|
||||
return dict(extension=extension, passphrase=passphrase, data=base64.b64encode(data))
|
||||
return dict(extension=extension, passphrase=passphrase, data=base64.b64encode(data).decode('utf-8'))
|
||||
|
||||
|
||||
api.add_resource(CertificatesList, '/certificates', endpoint='certificates')
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2 class="featurette-heading">Domains
|
||||
<span class="text-muted"><small>Zone transfers as scary</small></span></h2>
|
||||
<span class="text-muted"><small>Zone transfers are scary</small></span></h2>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<div class="btn-group pull-right">
|
||||
|
|
Loading…
Reference in New Issue