Skip to content

cannot import PKCS12 #8357

Open
Open

Description

@g3nsvrv

Problem Description

PKCS12 ask for password.

Steps to reproduce the behavior:

  1. http://mitm.it/#Windows
  2. Download Certificate
  3. Open
  4. Click Next
  5. Error
Image

System Information

Mitmproxy: 12.2.3 binary
Python:    3.14.4
OpenSSL:   OpenSSL 3.5.5 27 Jan 2026
Platform:  Windows-10-10.0.19045-SP0

Checklist

Workaround

I added the Cert Certificate instead (linux pem, split cert/key, and add the cert file).

Activity

  1. added
    kind/triage
    on Aug 2, 2026
  2. changed the title [-]cannot import pfx[/-] [+]cannot import PKCS12[/+] on Aug 2, 2026
  3. mhils commented on Aug 20, 2026

    @mhils
    Member

    There is no password - does this affect other systems than Windows XP (?)?

  4. g3nsvrv commented on Aug 21, 2026

    @g3nsvrv
    Author

    There is no password - does this affect other systems than Windows XP (?)?

    My guess, all windows versions. You can't extract the crt and key without a password using OpenSSL. PFX requires a password.

    On my case I use windows xp as example, I found this software useful to keep navigating on today's wwww.

  5. andremarquesamarante commented on Aug 23, 2026

    @andremarquesamarante

    @g3nsvrv I just tested in my Windows 11 machine and it worked fine when following the instructions. Are you sure that this isn't a issue only with Windows XP?

  6. g3nsvrv commented on Aug 23, 2026

    @g3nsvrv
    Author

    @g3nsvrv I just tested in my Windows 11 machine and it worked fine when following the instructions. Are you sure that this isn't a issue only with Windows XP?

    Same issue on windows 7

    Image
  7. g3nsvrv commented on Aug 23, 2026

    @g3nsvrv
    Author

    windows 10 does not have this issue

    Image
  8. g3nsvrv commented on Aug 23, 2026

    @g3nsvrv
    Author

    Also, and as I said at the beginning:

    There is no password - does this affect other systems than Windows XP (?)?

    My guess, all windows versions. You can't extract the crt and key without a password using OpenSSL. PFX requires a password.

    On my case I use windows xp as example, I found this software useful to keep navigating on today's wwww.

    OpenSSL does not extract the cert, and it generates an empty file.

    g3nsvrv@pc:~/Desktop/cert$ openssl pkcs12 -in mitmproxy-ca-cert.p12 -nocerts -nodes -out clientcert.key
    Enter Import Password:
    
    g3nsvrv@pc:~/Desktop/cert$ ll
    total 4.0K
    drwxr-xr-x 1 g3nsvrv g3nsvrv 4.0K Aug 23 18:30 .
    drwxrwxrwx 1 g3nsvrv g3nsvrv 4.0K Aug 23 18:29 ..
    -rw------- 1 g3nsvrv g3nsvrv    0 Aug 23 18:30 clientcert.key
    -rwxrwxrwx 1 g3nsvrv g3nsvrv 1.1K Aug 23 18:28 mitmproxy-ca-cert.p12
    
    g3nsvrv@pc:~/Desktop/cert$ openssl pkcs12 -in mitmproxy-ca-cert.p12 -clcerts -nokeys -out clientcert.cer
    Enter Import Password:
    
    g3nsvrv@pc:~/Desktop/cert$ ll
    total 4.0K
    drwxr-xr-x 1 g3nsvrv g3nsvrv 4.0K Aug 23 18:33 .
    drwxrwxrwx 1 g3nsvrv g3nsvrv 4.0K Aug 23 18:29 ..
    -rw------- 1 g3nsvrv g3nsvrv    0 Aug 23 18:33 clientcert.cer
    -rw------- 1 g3nsvrv g3nsvrv    0 Aug 23 18:30 clientcert.key
    -rwxrwxrwx 1 g3nsvrv g3nsvrv 1.1K Aug 23 18:28 mitmproxy-ca-cert.p12
  9. reneleonhardt commented on Oct 25, 2026

    @reneleonhardt
        `OpenSSL` does not extract the cert, and it generates an empty file.
    

    Does this happen with the latest OpenSSL 4.1.0 too, instead of the reported OpenSSL 3.5.5 27 Jan 2026?
    https://github.com/openssl/openssl/blob/master/CHANGES.md

  10. g3nsvrv commented on Oct 31, 2026

    @g3nsvrv
    Author
        `OpenSSL` does not extract the cert, and it generates an empty file.
    

    Does this happen with the latest OpenSSL 4.1.0 too, instead of the reported OpenSSL 3.5.5 27 Jan 2026?
    https://github.com/openssl/openssl/blob/master/CHANGES.md

    I think that it does not matter, windows always needed password for the PFX

    https://www.advancedinstaller.com/what-is-pfx-certificate.html

    A Personal Information Exchange (.pfx) Files, is password protected file certificate commonly used for code signing your application

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions