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

Fix SSL Certificate decode error (pkcs12: expected exactly two items in the authenticated safe) #14

Closed
wants to merge 3 commits into from

Conversation

fpawel
Copy link

@fpawel fpawel commented Jul 2, 2020

The solution for the problem discribed here. It works well for me.

@AGWA
Copy link
Member

AGWA commented Jul 2, 2020

As I mentioned in the bug report linked from that bug report, I would review a PR for a DecodeAll function: golang/go#14015 (comment)

I don't think changing the existing functions to silently ignore extra data is a good idea.

@AGWA AGWA closed this Jul 2, 2020
@AGWA
Copy link
Member

AGWA commented Jul 2, 2020

Oh, I just noticed that there's already an open PR for this, #8. I'll try to take a look soon.

@fpawel
Copy link
Author

fpawel commented Jul 2, 2020

If I understood correctly, this behavior will not be changed and the problem is not solved

@AGWA
Copy link
Member

AGWA commented Jul 2, 2020

Yes, looking at the PR I agree it is incomplete.

Could you provide an example PKCS#12 which I can use for testing?

@fpawel
Copy link
Author

fpawel commented Jul 3, 2020

@AGWA, I can not unfortunately, because I've got it form AMQP. @tipycalFlow mentioned "Production Apple Push Notification Service", but I have no way to use it. If I create a certificate using OpenSSL, f.e. :

  1. openssl genrsa -out key.pem
  2. openssl req -new -x509 -extensions v3_ca -keyout key.pem -out cert.pem -days 365
  3. cat key.pem cert.pem > cert.txt
  4. openssl pkcs12 -export -in cert.txt -out cert.p12
    then cert.p12 wil be valid pkcs12 certificate, that your library correctly opens.

@AGWA AGWA added the feature label Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants