【问题标题】:Getting SSL related error against my request to Ejabberd针对我对 Ejabberd 的请求获取 SSL 相关错误
【发布时间】:2015-08-20 06:30:21
【问题描述】:

以下是代码 sn-p,我在其中打开一个套接字以在其上写入 APNS 通知:

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

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

我的 ejabberd.log 文件中出现以下崩溃

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

可能出了什么问题?

【问题讨论】:

  • 你使用的是哪个版本的 Erlang?
  • 今天遇到了同样的问题。一定是苹果在他们的服务器上引入了一些变化。
  • 几天前也看到了这个问题。重新启动我的服务器修复了生产,但调试令牌仍然无法正常工作。
  • @TrespassersW 我得到这个:** 当状态 == hello ** 数据 == [{data, [{"StateData",{state,client, {#Ref ,}, gen_tcp,tls_connection,tcp,tcp_closed,tcp_error,"gateway.sandbox.push.apple.com",2195, 等等..

标签: android sockets ssl erlang ejabberd


【解决方案1】:

您可以这样做。我在沙盒环境中工作,经过一些修补后,我可以让它工作。

按照此处完成的修补操作:

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

您需要更改 ssl_cipher.erl 和 ssl_handshake.erl 文件。这两个文件是您正在使用的 Erlang OTP 的一部分,而不是 ejabberd。

就我而言,路径是:

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

编译完这 2 个 erls,您必须将梁移动到 /usr/local/lib/erlang/lib/ssl-5.3.2/ebin。

重新启动 Ejabberd。并检查推送通知是否有效。 通常,他们应该这样做。

【讨论】:

  • 谢谢你!它有帮助。我现在可以在我的设置中得到这些。 Apple Inc. 在进行此类加密更改之前应该考虑开发人员。无法追踪的影响。 ://
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-04-17
  • 1970-01-01
  • 2012-10-09
  • 1970-01-01
相关资源
最近更新 更多