Getting SSL related error regarding my request to Ejabberd

Below is the code snippet in which I open a socket to write APNS notifications:

 get_socket()->
 %%Options
  Options = [{certfile, ?Cert}, {keyfile, ?Key}, {mode, binary}],
  %%ssl connection
  ssl:connect(?Address, ?Port, Options, infinity)
.

 close_socket(Socket)->
 ssl:close(Socket).

      

I am getting the following failure in my ejabberd.log file

2015-06-05 12:33:17.112 [error] <0.3134.0> gen_fsm <0.3134.0> in state certify terminated with reason: no function clause matching ssl_cipher:hash_algorithm(239) line 1174

2015-06-05 12:33:17.113 [error] <0.3134.0> CRASH REPORT Process <0.3134.0> with 0 neighbours exited with reason: no function clause matching ssl_cipher:hash_algorithm(239) line 1174 in gen_fsm:terminate/7 line 622

2015-06-05 12:33:17.113 [error] <0.99.0> Supervisor tls_connection_sup had child undefined started with {tls_connection,start_link,undefined} at <0.3134.0> exit with reason no function clause matching ssl_cipher:hash_algorithm(239) line 1174 in context child_terminated

2015-06-05 12:33:17.113 [error] <0.3133.0> CRASH REPORT Process <0.3133.0> with 0 neighbours exited with reason: {{function_clause,[{ssl_cipher,hash_algorithm,"ï",[{file,"ssl_cipher.erl"},{line,1174}]},{ssl_handshake,'-decode_handshake/3-blc$^0/1-0-',1,[{file,"ssl_handshake.erl"},{line,898}]},{ssl_handshake,'-deode_handshake/3-blc$^0/1-0-',1,[{file,"ssl_handshake.erl"},{line,899}]},{ssl_handshake,decode_handshake,3,[{file,"ssl_handshake.erl"},{line,898}]},{tls_handshake,get_tls_handshake_aux,3,[{file,"tls_handshake.erl"},{line,153}]},{tls_connection,next_state,4,[{file,"tls_connection.erl"},{line,454}]},...]},...} in gen_fsm:sync_send_all_state_event/3 line 240

2015-06-05 12:33:17.113 [error] <0.377.0> Supervisor ejabberd_http_sup had child undefined started with {ejabberd_http,start_link,undefined} at <0.3133.0> exit with reason {{function_clause,[{ssl_cipher,hash_algorithm,"ï",[{file,"ssl_cipher.erl"},{line,1174}]},{ssl_handshake,'-decode_handshake/3-blc$^0/1-0-',1,[file,"ssl_handshake.erl"},{line,898}]},{ssl_handshake,'-decode_handshake/3-blc$^0/1-0-',1,[{file,"ssl_handshake.erl"},{line,899}]},{ssl_handshake,decode_handshake,3,[{file,"ssl_handshake.erl"},{line,898}]},{tls_handshake,get_tls_handshake_aux,3,[{file,"tls_handshake.erl"},{line,153}]},{tls_connection,next_state,4,[{file,"tls_connection.erl"},{line,454}]},...]},...} in context child_terminated

2015-06-05 12:33:17.372 [debug] <0.3074.0>@ejabberd_receiver:process_data:343 Received XML on stream = <<"<iq type=\"get\" to=\"+919333333333@devlab\" id=\"vCard-Temp2C753D87-6F56-48D5-B3CF-09C1B1DF46F7\"><vCard xmlns=\"vcard-temp\"/></iq>">>

2015-06-05 12:33:17.372 [debug] <0.3074.0>@shaper:update:117 State: {maxrate,1000,623.3758292140764,1433496796970483}, Size=125
M=90.80183440963172, I=402.231

      

What could be wrong?

+3


source to share


1 answer


Here's how you can do it. I am working on a sandbox environment and after a little fix I can get it to work.

Follow the fixes made here:

http://erlang.org/pipermail/erlang-questions/2015-June/084868.html

You will need to edit the ssl_cipher.erl and ssl_handshake.erl files. These 2 files are part of the Erlang OTP used, not ejabberd.



In my case, the path is:

/usr/local/lib/erlang/lib/ssl-5.3.2/src

With these 2 erls compiled, you will need to move the beams to / usr / local / lib / erlang / lib / ssl -5.3.2 / ebin.

Restart Ejabberd. And check how Push notifications work. Usually they should.

+2


source







All Articles