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

Loading .p12 certificate: ans1: indefinite length found (not DER) #46

Closed
gngeorgiev opened this issue Oct 14, 2016 · 4 comments
Closed

Comments

@gngeorgiev
Copy link

Hello,

I am trying to use the apns2 module but when I try to load the p12 file I get the following error

ans1: indefinite length found (not DER)

I was able to convert the file to .pem using the command line openssl, and it worked but this is not an ideal solution, I need to be able to use the p12 file directly or convert it to pem at runtime. Sadly the openssl bindings do not offer this functionality as of now. Any suggestions?

@sideshow
Copy link
Owner

@gngeorgiev thanks for logging.
I haven't seen this before, so are you able to share more info about your environment and your cert.

@sideshow
Copy link
Owner

@gngeorgiev did you manage to get any further on this?

@gngeorgiev
Copy link
Author

@sideshow Yeah, I did.

Turns out my certificates were indeed a bit weird, since regenerating them fixed the problems. However, I needed the old ones to work, since I need to be able to handle arbitrary use cases. In the end I ended up using the openssl command line tool, passing certificates in stdin and getting the decoded certificate and private key from stdout. I don't think there is anything you can do except document this case.

@sideshow
Copy link
Owner

Thanks @gngeorgiev I have added a separate issue to add more docs around this. #54

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

2 participants