Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: BAD_PKCS12_DATA #8701

Open
aevtyushin opened this issue Jun 23, 2020 · 27 comments
Open

Error: BAD_PKCS12_DATA #8701

aevtyushin opened this issue Jun 23, 2020 · 27 comments

Comments

@aevtyushin
Copy link

After upgrading to the latest version (7.26.1) .pfx certificates stopped working for me. I keep getting Error: BAD_PKCS12_DATA error, although everything worked fine before the update.

image
image

  • Native App
  • Postman Version 7.26.1
  • OS: macOS High Catalina 10.15.5
@numaanashraf
Copy link
Member

@aevtyushin Would it be possible to share the cert.pfx file with us via email (help@postman.com)? It'll help us take a deeper look at the certificate and understand why its failing in v7.26.1 and provide a faster resolution to this issue.

@mindstep
Copy link

Same for me, PFX client certificate, "BAD_PKCS12_DATA".

  • Postman Version 7.27.0
  • OS: macOS Mojave 10.14.6

@aevtyushin
Copy link
Author

@aevtyushin Would it be possible to share the cert.pfx file with us via email (help@postman.com)? It'll help us take a deeper look at the certificate and understand why its failing in v7.26.1 and provide a faster resolution to this issue.

i sent cert.pfx to help@postman.com

@marcushoja
Copy link

same for me

  • ubuntu 18.04 lts
  • postman 7.26.1

works well when reinstalling 7.5
is it possible to disable minor updates?

@martintefger
Copy link

Same for me, PFX client certificate, "BAD_PKCS12_DATA".

Postman Version 7.27.0
OS: macOS Catalina 10.15.5 (19F101)

@mmulhearn
Copy link

Seeing this as well on 7.27.1 on Windows 10.

@isacaguiar
Copy link

Same for me on 7.27.1 on Windows 10.

@anilsoni85
Copy link

Same for me Postman v7.27.1 on Windows 10. It used to work before update.

@numaanashraf
Copy link
Member

@marcushoja @martintefger @mmulhearn @isacaguiar @anilsoni85

It’d be great if you could share the output of the following command (via help@postman.com) to help us identify this issue:

openssl pkcs12 -in /path/to/client-cert.pfx -info

@mccannt mccannt added the support How do I ... ? Can I ... ? label Jul 9, 2020
@anilsoni85
Copy link

@numaanashraf I can't share cert info due to policy. I have tried this on 7.28.0 and it is still broken with same error. Could you please provide me steps to turn off auto update and forcefully downgrade postman to 7.25. I don't want update until this issue gets fixed.

@martintefger
Copy link

martintefger commented Jul 17, 2020

still existing on Version 7.28.0

OSX 10.15.5 and Windows 8.1

@martintefger
Copy link

still existing on Version 7.29.1

OSX 10.15.5 and Windows 8.1

@JOSEPHREDDY07
Copy link

is this solved. I am also getting same error after upgrade?

@martintefger
Copy link

it is working for me with the PostmanCanary, but not with the normal version.

@JOSEPHREDDY07
Copy link

it is working for me with the PostmanCanary, but not with the normal version.

Thank you. Now i get certificate error. i am using same certificate in internet explorer(get api), it is working there.

@AnilJain0810
Copy link

AnilJain0810 commented Nov 5, 2020

I tried with a new certificate and it's working fine in the browser but not working in Postman and PostmanCanary as well and i am getting BAD_PKCS12_DATA on (.pfx) certificate... Any solution?

@eirjens
Copy link

eirjens commented Jan 8, 2021

Still no fix for P12 certificates?

GET https://postman-echo.com/
Error: BAD_PKCS12_DATA

Windows 10, Postman Desktop v7.36.1

@fappaz
Copy link

fappaz commented Feb 24, 2021

Same for me on Version 8.0.6, win32 10.0.19041 / x64.

My pfx certificate works on curl and SoapUI.

@jordanengstrom
Copy link

Same for me on Postman Desktop v8.0.10, Windows 10

@anilsoni85
Copy link

I have noticed that Postman gives error when PFX file contains chain of CA certificates. I used openssl to export only client certificate from .p12 file (PKCS12 format) to pem format and key using below commands

openssl pkcs12 -in certificate.p12 -clcerts -nokeys -out certificate.crt
[Enter p12 password when prompted]

openssl pkcs12 -in certificate.p12 -nocerts -out certificate.key
[Enter p12 password when prompted]
[Create passphrase for key file when prompted.]

then Add certificate in Postman File -> Settings -> Certificate
crt = browse and select certificate.crt
key = browse and select key file
passphrase = passphrase of key file

This fixed the error

@sebainones
Copy link

Is there any update on this or any hint on how to solve it. I'm not expert on this matter, so any help is always more than welcome.

@Mavsousa30
Copy link

I have noticed that Postman gives error when PFX file contains chain of CA certificates. I used openssl to export only client certificate from .p12 file (PKCS12 format) to pem format and key using below commands

openssl pkcs12 -in certificate.p12 -clcerts -nokeys -out certificate.crt [Enter p12 password when prompted]

openssl pkcs12 -in certificate.p12 -nocerts -out certificate.key [Enter p12 password when prompted] [Create passphrase for key file when prompted.]

then Add certificate in Postman File -> Settings -> Certificate crt = browse and select certificate.crt key = browse and select key file passphrase = passphrase of key file

This fixed the error

Worked for me too.

@sageTimNewton
Copy link

I was getting this error, however after removing and re-adding the same certificate it worked ok.....?

@DannyDainton DannyDainton added bug Certificate product/runtime and removed support How do I ... ? Can I ... ? labels Jun 30, 2022
@kristofferjalen
Copy link

I had the same problem, and I solved it (or got it working at least) by generating the certificate by following some Microsoft documentation:

New-SelfSignedCertificate -DnsName "localhost", "localhost" -CertStoreLocation "cert:\LocalMachine\My" -NotAfter (Get-Date).AddYears(20) -FriendlyName "localhost" -KeyUsageProperty All -KeyUsage CertSign, CRLSign, DigitalSignature

$mypwd = ConvertTo-SecureString -String "asdfhaiusdhfaosiufdh" -Force -AsPlainText

$thumbprint = (Get-ChildItem -Path cert:\localMachine\my | Where-Object {$_.FriendlyName -Match "localhost"}).Thumbprint

Get-ChildItem -Path cert:\localMachine\my\$thumbprint | Export-PfxCertificate -FilePath C:\dev\localhost.pfx -Password $mypwd

I then imported the pfx file to "Trusted Root Certification Authorities" in Windows.

Then I added the pfx file to Postman, provided the password and used localhost as host, and it worked.

@aevtyushin
Copy link
Author

The easiest and most working way is to simply separate the .pfx file into a private key and a certificate, and use them separately.

You can separate .pfx file using the OpenSSL:
openssl pkcs12 -in [yourfile.pfx] -nocerts -out [drlive.key]
openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [drlive.crt]

Usage .key and .crt in Postman:
image

@i-ivd
Copy link

i-ivd commented Oct 20, 2023

3 Years and still open

Bug still there.
Linux, Postman Desktop October 2023 (v10.19)

@dillius
Copy link

dillius commented Nov 20, 2023

Also seeing this. Haven't found a solution yet.

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

No branches or pull requests