-
Notifications
You must be signed in to change notification settings - Fork 338
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
Can not understand how to generate acceptable pem cert #33
Comments
As you guessed, it has to do with the format of the pem file generated by the way your calling openssl. See this related discussion: https://groups.google.com/forum/#!msg/golang-nuts/ZZ1Wt9d268Q/gQGh6e-wGAAJ. To use the certificate you have, you need to modify certificates.go and rebuild. It worked for me by importing crypto/rsa and crypto/ecdsa then modifying ParsePrivateKey ( apns2/certificate/certificate.go Line 122 in eacc6af
Alternatively and easier you may be able to get the certificate file in the right form for ParsePKCS1PrivateKey through openssl, nothing I tried seemed to work so can't help you there. |
Hey @cenkbilgen , good find. A pull request would be awesome! |
@sideshow @cenkbilgen thanks |
@cenkbilgen thanks again for the info. |
@sideshow thank you. i will check it today and report you back. |
Awesome thanks. |
@sideshow @seenickcode @roma86 @cenkbilgen this is to confirm that fix-parse-private-key is working for us in production mode. |
I am not sure if this is related or fixed already, but I had problems with certificates that include full chain info (4 nodes instead of 2) for both pem and p12. For pem, a workable solution is to trim the certificate with file io since it's plain text (take the first and last node). For p12, convert the certificate to pem via this command:
This ensures a 2 node pem is outputted, whether the p12 is 4 or 2 node. |
Closing this as better docs will be added as part of this issue #54 |
Hello. Thank you for the lib.
I use this command to convert p12 cer to pem
Which is works fine when i test it with ruby houston gem.
To test this lib i just use example code from readme, only path to the pem file is changed.
The result is error message
Which is referenced to
apns2/certificate/certificate.go
from this lib.When it fail i tried to send passphrase as the last param into
certificate.FromPemFile
without success.My questions are:
Thanks in advance.
go version go1.6.2 darwin/amd64
When i say works fine i mean push notifications are delivered to destination device.
The text was updated successfully, but these errors were encountered: