From 7eb77245c39f03550be472a4862ce4075343b547 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 6 Nov 2014 23:22:00 +0100 Subject: [PATCH] fix cert creation --- peerlink/tls.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/peerlink/tls.py b/peerlink/tls.py index 75df231..cc35613 100644 --- a/peerlink/tls.py +++ b/peerlink/tls.py @@ -26,12 +26,12 @@ def create_certificate(tls_key_path, tls_cert_path, USER_ID): ca.set_issuer(ca.get_subject()) ca.set_pubkey(key) ca.add_extensions([ - OpenSSL.crypto.X509Extension("basicConstraints", True, "CA:TRUE, pathlen:0"), - OpenSSL.crypto.X509Extension("nsCertType", True, "sslCA"), - OpenSSL.crypto.X509Extension("extendedKeyUsage", True, - "serverAuth,clientAuth,emailProtection,timeStamping,msCodeInd,msCodeCom,msCTLSign,msSGC,msEFS,nsSGC"), - OpenSSL.crypto.X509Extension("keyUsage", False, "keyCertSign, cRLSign"), - OpenSSL.crypto.X509Extension("subjectKeyIdentifier", False, "hash", subject=ca), + OpenSSL.crypto.X509Extension(b"basicConstraints", True, b"CA:TRUE, pathlen:0"), + OpenSSL.crypto.X509Extension(b"nsCertType", True, b"sslCA"), + OpenSSL.crypto.X509Extension(b"extendedKeyUsage", True, + b"serverAuth,clientAuth,emailProtection,timeStamping,msCodeInd,msCodeCom,msCTLSign,msSGC,msEFS,nsSGC"), + OpenSSL.crypto.X509Extension(b"keyUsage", False, b"keyCertSign, cRLSign"), + OpenSSL.crypto.X509Extension(b"subjectKeyIdentifier", False, b"hash", subject=ca), ]) ca.sign(key, "sha1") with open(tls_cert_path, 'wb') as fd: