-
Notifications
You must be signed in to change notification settings - Fork 215
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
Erlang/OTP 18? #164
Comments
Hi @cwmaguire, I didn't test apns4erl with Erlang 18. If you did the hack and it compiles well I would think your issue could be related with openssl since it needs TLS 1.2+. Even if you connected with s_client, did you try to send something to APNs? Did you get a response from it? |
We have openssl 1.0.2j. I tried doing "GET https://www.howsmyssl.com/a/check HTTP/1.1" and it reported that GET was using TLS 1.2. I haven't tried sending anything with SSL yet. I'll look up how to do that and see if I can successfully send something. Thanks for the tip. |
Okay, I can send a push with curl using a certificate and I get BadDeviceToken, so that's a start! I'll dig through the SSL traces and see what I can come up with. Thanks for the help. |
I picked up these SSL options from here and I was able to connect. |
@cwmaguire where did you these options? I am getting this error #118 Please help me resolve this. |
I added these options to the TransportOpts list in apns_connection:open_gun_connection/1. TransportOpts = case type(Connection) of
cert ->
Certfile = certfile(Connection),
Keyfile = keyfile(Connection),
[{certfile,Certfile},
{keyfile,Keyfile},
{honor_cipher_order, false},
{versions, ['tlsv1.2']},
{alpn_preferred_protocols, [<<"h2">>]}]; |
@monkeyfdude Note that we're using the new APNS HTTP/2 API. I see from #118 that you're accessing the "legacy" binary SSL API at gateway.sandbox.push.apple.com whereas I'm using api.development.push.apple.com:443 which is the HTTP/2 API. |
Hi @monkeyfdude, since you are trying to update your apns4erl to v2, I recommend you to make some tests first. I mean, download the apns4erl code and play with the console until you achieve push something to APNS and forwarding the messages to your devices. Once you achieve this that implies your certificate and headers are correct, then you can to try to update the library in your ejabberd server. |
I get
Code changes:
test.config:
|
you have to change the data regarding your app. This is not correct
I guess you don't have the app "com.example.myapp" registered in Apple |
did you try to push something without apns4erl? are you sure your certs and http2 headers are correct? |
@ferigis You may be right. Let me investigate. Please keep an eye on this issue. I will keep updating as I investigate. |
I was able to connect & send atleast 1 notification successfully. Thanks for all your help. I have other issues. I am opening a new issue #169 |
apn4serl compiles under Erlang/OTP 18.2 with a minor changes (as of 25ad9d2). Is there anything else (e.g. ssl) that specifically requires Erlang/OTP 19+? I've got everything coded up for Erlang/OTP 18.2 (large project, hard to upgrade) but I can't connect to the APNS server: I just keep getting a timeout. Before I go any further I'd like to know if our Erlang version is maybe the issue. (I can connect with openssl s_client, but not with apns4erl).
The text was updated successfully, but these errors were encountered: