Log error message when error is thrown in apns initialization #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TL; DR
This was swallowing errors from the
a2
crate that would have been helpful to see. This PR adds logging to surface a more useful error message.Background
I was attempting to setup
fpush
and got the following error on startup:The error wasn't particularly descriptive, so I traced it to the
fpush-apns
package and added the logging in this PR.After adding the logging this is what surfaced:
For anyone who gets this error: I exported my push certificate from Keychain Access in macOS as a
p12
file. What seems to be happening is that Keychain Access is encrypting the private key with an outdated algorithm and OpenSSL in thea2
crate is choking on it because that algorithm isn't loaded by default. I couldn't figure out a way to load thelegacy
provider infpush
so what I ended up doing was using theopenssl
cli tool to export the key topem
format using the-legacy
flag, then convert it back top12
. Hope this helps someone not bash their head against a wall for 3 hours like I did.