非常感谢那个 ldd 命令!它解决了我的问题:-D
事情是这样的:显然 tls_drv.so 正在寻找 libssl.so.0.9.8 和 libcrypto.so.0.9.8,而 ejabberd 包括 0.9.7。我碰巧安装了 libssl.so.0.9.8e 和 libcrypto.so.0.9.8e,tls_drv.so 找不到(因为'e'?)。
我所做的是创建一个指向 0.9.8e 的符号链接,命名为 0.9.8。瞧!有效!
这里有更多信息:
- Centos 5.5, 32 位
- ejabberd 2.1.8
- 我直接从 www.process-one.net (www.ejabberd.im) 下载了二进制安装程序
- 我仍然有默认配置,除了安装程序需要的主机名和管理员用户。
- 在没有 TLS 的情况下,来自 jabber 客户端的连接似乎可以正常工作。当我将客户端配置为在可用时加密连接时,问题就来了。
这是修复前抱怨的 erlang 日志:
=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}]
这是修复它的过程:
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]#
我重新启动了 ejabberd,就是这样!
我真的希望它可以帮助其他人,因为谷歌搜索让我找到了很多有同样问题的人,但没有一个解决方案。
问候!
马加纳普