|
|
|
@ -105,7 +105,7 @@ def makeRequest(pubkey, pkey, serv_host, port):
|
|
|
|
|
extstack = X509.X509_Extension_Stack()
|
|
|
|
|
extstack.push(ext1)
|
|
|
|
|
req.add_extensions(extstack)
|
|
|
|
|
req.sign(pkey, 'md5')
|
|
|
|
|
req.sign(pkey, 'sha256')
|
|
|
|
|
return req
|
|
|
|
|
|
|
|
|
|
class CreateCertError(Exception):
|
|
|
|
@ -140,7 +140,7 @@ def create_selfsigned_ca(dn_data, keyfile, certfile):
|
|
|
|
|
#crypto.X509Extension(b'keyUsage', False, b'keyCertSign, cRLSign'),
|
|
|
|
|
crypto.X509Extension(b'subjectKeyIdentifier', False, b'hash', subject=ca)])
|
|
|
|
|
ca.add_extensions([crypto.X509Extension(b'authorityKeyIdentifier', False, b'keyid:always',issuer=ca)])
|
|
|
|
|
ca.sign(pkey, 'sha1')
|
|
|
|
|
ca.sign(pkey, 'sha256')
|
|
|
|
|
|
|
|
|
|
with writeFile(certfile, binary=True) as f:
|
|
|
|
|
f.write(crypto.dump_certificate(crypto.FILETYPE_PEM, ca))
|
|
|
|
|