diff options
author | Oliver Graff <oliver.e.graff@gmail.com> | 2017-06-12 00:44:29 -0700 |
---|---|---|
committer | Oliver Graff <oliver.e.graff@gmail.com> | 2017-06-12 01:44:26 -0700 |
commit | bd9d0bf6b1bd01ee989a729278e64b73de13ccfc (patch) | |
tree | a7fe5c0c1a434a62d451e18900a94285806c0b27 /mitmproxy/certs.py | |
parent | 93d37e29c382240c688c574c2369d8a947a1e8f9 (diff) | |
download | mitmproxy-bd9d0bf6b1bd01ee989a729278e64b73de13ccfc.tar.gz mitmproxy-bd9d0bf6b1bd01ee989a729278e64b73de13ccfc.tar.bz2 mitmproxy-bd9d0bf6b1bd01ee989a729278e64b73de13ccfc.zip |
Remove private key from PKCS12 file
Fixes #2349
Diffstat (limited to 'mitmproxy/certs.py')
-rw-r--r-- | mitmproxy/certs.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mitmproxy/certs.py b/mitmproxy/certs.py index 618b34de..0e441efe 100644 --- a/mitmproxy/certs.py +++ b/mitmproxy/certs.py @@ -266,6 +266,12 @@ class CertStore: 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) f.write(p12.export()) |