Search code examples
windowsssl-certificateman-in-the-middlemitmproxy

Can't add a mitmproxy .p12 certificate to Windows programmatically


I want to programmatically install certificate into Windows for localhost MITM SSL sniffing.

>certutil -addstore "TrustedPublisher" mitmproxy-ca-cert.p12
TrustedPublisher
CertUtil: -addstore команда НЕ ВЫПОЛНЕНА: 0x80093102 (ASN: 258)
CertUtil: В ASN1 встречен неожиданный конец данных.

means in English the Unexpected end of data While this command:

>certutil -asn \Users\Nakilon\.mitmproxy\mitmproxy-ca-cert.p12
CertUtil: -asn - команда успешно выполнена.

doesn't see any issue.


Solution

  • You can just convert .p12 cert to .pem and then you will be able to import it through your command.