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

apns:connect error #234

Closed
Akick opened this issue Sep 14, 2020 · 3 comments
Closed

apns:connect error #234

Akick opened this issue Sep 14, 2020 · 3 comments

Comments

@Akick
Copy link

Akick commented Sep 14, 2020

Erlang 22. gun - master, apns4erl - master.
I do all as in the example.

But:
apns:connect(#{name => another_cert, apple_host => "api.push.apple.com", apple_port => 443, certfile => "priv/aps.pem", keyfile => "priv/AuthKey.pem", type => cert}).
and
apns:connect(cert, another_connection).

{ok, pid()}
19:43:32.909 [error] gen_statem another_connection in state open_common terminated with reason: {{badmatch,{error,{options,{transport_opts,[{certfile,"./keys/aps.pem"},{keyfile,"./keys/AuthKey.pem"}]}}}},state_functions}
19:43:32.909 [error] CRASH REPORT Process another_connection with 0 neighbours crashed with reason: no match of right hand value {error,{options,{transport_opts,[{certfile,"./keys/aps.pem"},{keyfile,"./keys/AuthKey.pem"}]}}} in apns_connection:open_common/3 line 254
19:43:32.910 [error] Supervisor apns_sup had child apns_connection started with {apns_connection,start_link,undefined} at <0.2390.0> exit with reason no match of right hand value {error,{options,{transport_opts,[{certfile,"./keys/aps.pem"},{keyfile,"./keys/AuthKey.pem"}]}}} in apns_connection:open_common/3 line 254 in context child_terminated

If I call apns:connect(token, another_connection) I get:
19:48:30.123 [error] gen_statem another_connection in state open_common terminated with reason: {{badmatch,{error,{options,{transport_opts,[]}}}},state_functions}
19:48:30.123 [error] CRASH REPORT Process another_connection with 0 neighbours crashed with reason: no match of right hand value {error,{options,{transport_opts,[]}}} in apns_connection:open_common/3 line 254
19:48:30.123 [error] Supervisor apns_sup had child apns_connection started with {apns_connection,start_link,undefined} at <0.3103.0> exit with reason no match of right hand value {error,{options,{transport_opts,[]}}} in apns_connection:open_common/3 line 254 in context child_terminated.

What am I doing wrong?

@Akick
Copy link
Author

Akick commented May 30, 2022

https://github.com/inaka/apns4erl/blob/master/src/apns_connection.erl
Line 233 must be:
tls_opts => TransportOpts

@elbrujohalcon
Copy link
Member

@Akick do you mind sending a pull request with that change?
Thanks.

Akick added a commit to Akick/apns4erl that referenced this issue May 31, 2022
@Akick
Copy link
Author

Akick commented May 31, 2022

@elbrujohalcon Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants