开发者

eJabberD TLS driver error

I'm trying to get an ejabberd server running to use as a real time chat in an android application.

I have installed the server using a 32bit binary and configured it to a point that I can log in using the web interface. I have issues connecting to it with a client though. The error returned by the server is an {open_error,-10}, which is supposed to be an error when trying to read the tls_drv.so file.

Some searches on the web revealed that there are people with the same issue as me but I can't seem to find a concrete solution. This thread here http://www.ejabberd.im/node/4200 mentions the exact same problems as I'm having and the OP seemed to have fixed them using a newer version of the drivers开发者_运维百科. I don't know how or where to get those drivers though.

Can anyone here please help me fix this? Thank you.


Thanks a lot for that ldd command! It solved my issue :-D

Here's the thing: apparently tls_drv.so is looking for libssl.so.0.9.8 and libcrypto.so.0.9.8, and ejabberd includes 0.9.7. I happened to have installed libssl.so.0.9.8e and libcrypto.so.0.9.8e, which tls_drv.so couldn't find (because of the 'e'?).

What I did was creating a symbolic link to 0.9.8e, named 0.9.8. And voilà! It worked!

Here's some more info:

  • Centos 5.5, 32 bit
  • ejabberd 2.1.8
  • I downloaded the binary installer directly from www.process-one.net (www.ejabberd.im)
  • I still have the default configuration, except for the hostname and the admin user, which are required by the installer.
  • The connection from a jabber client seems to work fine without TLS. The problem came when I configured my client to encrypt connection when available.

Here's the erlang log complaining before the fix:

=CRASH REPORT==== 12-Sep-2011::22:48:56 ===
  crasher:
    pid: <0.372.0>
    registered_name: []
    exception exit: {{case_clause,{error,{open_error,-10}}},
                     [{tls,tcp_to_tls,2},
                      {ejabberd_socket,starttls,3},
                      {ejabberd_c2s,wait_for_feature_request,2},
                      {p1_fsm,handle_msg,10},
                      {proc_lib,init_p,5}]}
      in function  p1_fsm:terminate/7
    initial call: gen:init_it(p1_fsm,<0.258.0>,<0.258.0>,ejabberd_c2s,
                              [{ejabberd_socket,
                                   {socket_state,gen_tcp,#Port<0.406>,
                                       <0.371.0>}},
                               [inet,
                                {certfile,
                                    "/opt/ejabberd-2.1.8/conf/server.pem"},
                                starttls,
                                {access,c2s},
                                {shaper,c2s_shaper},
                                {max_stanza_size,65536},
                                {ip,{0,0,0,0}}]],
                              [])
    ancestors: [ejabberd_c2s_sup,ejabberd_sup,<0.36.0>]
    messages: []
    links: [<0.258.0>]
    dictionary: [{'$internal_queue_len',0}]
    trap_exit: false
    status: running
    heap_size: 987
    stack_size: 23
    reductions: 3258
  neighbours:

=SUPERVISOR REPORT==== 12-Sep-2011::22:48:56 ===
     Supervisor: {local,ejabberd_c2s_sup}
     Context:    child_terminated
     Reason:     {{case_clause,{error,{open_error,-10}}},
                  [{tls,tcp_to_tls,2},
                   {ejabberd_socket,starttls,3},
                   {ejabberd_c2s,wait_for_feature_request,2},
                   {p1_fsm,handle_msg,10},
                   {proc_lib,init_p,5}]}
     Offender:   [{pid,<0.372.0>},
                  {name,undefined},
                  {mfa,
                      {ejabberd_c2s,start_link,
                          [{ejabberd_socket,
                               {socket_state,gen_tcp,#Port<0.406>,<0.371.0>}},
                           [inet,
                            {certfile,"/opt/ejabberd-2.1.8/conf/server.pem"},
                            starttls,
                            {access,c2s},
                            {shaper,c2s_shaper},
                            {max_stanza_size,65536},
                            {ip,{0,0,0,0}}]]}},
                  {restart_type,temporary},
                  {shutdown,brutal_kill},
                  {child_type,worker}]

Here's the process to fix it:

root@mail [/opt/ejabberd-2.1.8]# find . -name tls_drv.so
./lib/ejabberd-2.1.8/priv/linux-x86/lib/tls_drv.so
root@mail [/opt/ejabberd-2.1.8]# cd lib/ejabberd-2.1.8/priv/linux-x86/lib/
root@mail [/opt/ejabberd-2.1.8/lib/ejabberd-2.1.8/priv/linux-x86/lib]# ldd tls_drv.so 
linux-gate.so.1 =>  (0x00f9c000)
libssl.so.0.9.8 => not found
libcrypto.so.0.9.8 => not found
libc.so.6 => /lib/libc.so.6 (0x00d9c000)
/lib/ld-linux.so.2 (0x00943000)
root@mail [/lib]# cd /lib
root@mail [/lib]# ll libcrypto.so.* libssl.so.*
-rwxr-xr-x 1 root root 1296964 Mar  6  2011 libcrypto.so.0.9.8e*
lrwxrwxrwx 1 root root      14 Nov 24  2009 libcrypto.so.4 -> libcrypto.so.6*
lrwxrwxrwx 1 root root      19 Apr 26 11:06 libcrypto.so.6 -> libcrypto.so.0.9.8e*
-rwxr-xr-x 1 root root  293044 Mar  6  2011 libssl.so.0.9.8e*
lrwxrwxrwx 1 root root      11 Nov 24  2009 libssl.so.4 -> libssl.so.6*
lrwxrwxrwx 1 root root      16 Apr 26 11:06 libssl.so.6 -> libssl.so.0.9.8e*
root@mail [/lib]# ln -s libcrypto.so.0.9.8e libcrypto.so.0.9.8
root@mail [/lib]# ln -s libssl.so.0.9.8e libssl.so.0.9.8
root@mail [/lib]# cd -
/opt/ejabberd-2.1.8/lib/ejabberd-2.1.8/priv/linux-x86/lib
root@mail [/opt/ejabberd-2.1.8/lib/ejabberd-2.1.8/priv/linux-x86/lib]# ldd tls_drv.so 
./tls_drv.so: /lib/libcrypto.so.0.9.8: no version information available (required by ./tls_drv.so)
./tls_drv.so: /lib/libssl.so.0.9.8: no version information available (required by ./tls_drv.so)
linux-gate.so.1 =>  (0x0088c000)
libssl.so.0.9.8 => /lib/libssl.so.0.9.8 (0x00110000)
libcrypto.so.0.9.8 => /lib/libcrypto.so.0.9.8 (0x00ebf000)
libc.so.6 => /lib/libc.so.6 (0x00252000)
libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x008ef000)
libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x00ae0000)
libcom_err.so.2 => /lib/libcom_err.so.2 (0x0077c000)
libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00527000)
libresolv.so.2 => /lib/libresolv.so.2 (0x00158000)
libdl.so.2 => /lib/libdl.so.2 (0x0016c000)
libz.so.1 => /usr/lib/libz.so.1 (0x00a67000)
/lib/ld-linux.so.2 (0x00943000)
libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x00df3000)
libkeyutils.so.1 => /lib/libkeyutils.so.1 (0x00e2a000)
libselinux.so.1 => /lib/libselinux.so.1 (0x008cc000)
libsepol.so.1 => /lib/libsepol.so.1 (0x00171000)
root@mail [/opt/ejabberd-2.1.8/lib/ejabberd-2.1.8/priv/linux-x86/lib]#

I restarted ejabberd, and that was it!

I really hope it helps someone else, since googling made me find a lot of people with the same issue, but not a single solution.

Regards!

maganap


Latest installer will solve this dependancy on ejabberd.

Thank you for reporting it !

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜