mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 18:18:25 +00:00
Merge pull request #2390 from ograff/remove_private_key_pkcs12
Remove private key from PKCS12 file
This commit is contained in:
commit
2ceefe9582
@ -264,6 +264,12 @@ class CertStore:
|
||||
|
||||
# Dump the certificate in PKCS12 format for Windows devices
|
||||
with open(os.path.join(path, basename + "-ca-cert.p12"), "wb") as f:
|
||||
p12 = OpenSSL.crypto.PKCS12()
|
||||
p12.set_certificate(ca)
|
||||
f.write(p12.export())
|
||||
|
||||
# Dump the certificate and key in a PKCS12 format for Windows devices
|
||||
with open(os.path.join(path, basename + "-ca.p12"), "wb") as f:
|
||||
p12 = OpenSSL.crypto.PKCS12()
|
||||
p12.set_certificate(ca)
|
||||
p12.set_privatekey(key)
|
||||
|
Loading…
Reference in New Issue
Block a user