esl / MongoosePush

MongoosePush is a simple Elixir RESTful service allowing to send push notification via FCM and/or APNS.
Apache License 2.0
108 stars 24 forks source link

Server cannot create ssl connection #208

Closed domenicostragliotto closed 6 months ago

domenicostragliotto commented 1 year ago

I've created test self signed certificates, and i'm able to make moongoose push find them but everytime i try to call the /healtcheck API in the log i get this error and the call fails

{ "at":".:", "erl_level":"error", "pid":"#PID<0.2067.0>", "report_cb":"#Function<0.82331278/1 in :error_logger."-fun.report_to_format/1-">", "severity":"error", "text":"Ranch listener MongoosePushWeb.Endpoint.HTTPS had connection process started with :cowboy_tls:start_link/4 at #PID<0.400.14> exit with reason: {:undef, [{:ssl, :ssl_accept, [{:sslsocket, {:gen_tcp, #Port<0.89374>, :tls_connection, [option_tracker: #PID<0.2069.0>, session_tickets_tracker: :disabled, session_id_tracker: #PID<0.2070.0>]}, [#PID<0.403.14>, #PID<0.405.14>]}, [], 5000], []}, {:ranch_ssl, :handshake, 3, [file: '/tmp/package/src/MongoosePush-2.1.0/deps/ranch/src/ranch_ssl.erl', line: 142]}, {:ranch, :handshake, 2, [file: '/tmp/package/src/MongoosePush-2.1.0/deps/ranch/src/ranch.erl', line: 243]}, {:cowboy_tls, :connection_process, 4, [file: '/tmp/package/src/MongoosePush-2.1.0/deps/cowboy/src/cowboy_tls.erl', line: 43]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 226]}]} ", "what":"", "when":"2023-05-16T15:31:20.626", "error_logger.tag":"error" }

I'm sincerely at a loss here since i'm not used to erlang and this error is not giving me infos i'm able to understad to pinpoint the problem or how to resolve it.

pawlooss1 commented 6 months ago

Could you tell which version of Erlang you're using? It looks like the ranch library is making a call to Erlang's standard library to a function that was deprecated and removed in some newer version. Also, we are preparing a patch release that upgrades all the dependencies and language version that should work well with the newest Erlang and Elixir. So, in the near future I recommend updating MongoosePush

pawlooss1 commented 6 months ago

Ok I see that function ssl:ssl_accept was removed in Erlang 24 - source. Please downgrade your Erlang version to 23 in order for this to work. For now I'll close this issue but have in mind that when the new release is out then you can upgrade MongoosePush and use it with the newest Erlang 26.