Addressing key file badmatch error while extracting APNS Socket
Since I ran into an unrecognized algorithm failure, I made a fix as mentioned here: http://erlang.org/pipermail/erlang-questions/2015-June/084870.html
CRASH is no longer displayed, but I am not getting any APNS notifications, even after that. I have a sandbox environment on my end.
when i start ejabberd shell:
mod_mymodule:get_socket().
I get:
{error,{keyfile,{badmatch,{error,{asn1,{invalid_length,6}}}}}}
My certificate and RSA private key file worked fine for several months until this came up.
The get_socket () method definition:
get_socket()->
%%Options
Options = [{certfile, ?Cert}, {keyfile, ?Key}, {mode, binary}],
%%ssl connection
ssl:connect(?Address, ?Port, Options, infinity) .
FYI, I have macros declared as:
-define(Cert,"/opt/ejabberd-14.07/bin/MantuPush/cert.pem").
-define(Key,"/opt/ejabberd-14.07/bin/MantuPush/finalkey.pem").
Note . I have not used CSR here as the examples do not specify the required (Guessing!).
What could be wrong? What is the correct certificate and private key used with APNS?
Kindly help. Thanks to
source to share
This is an Erlang bug. Check out our Erlang removal request for a quick hack and Github discussion: https://github.com/erlang/otp/pull/767
Here is a blog post explaining the problem: https://blog.process-one.net/apple-increasing-security-of-push-service-ahead-of-wwdc/
source to share