风翔万里
unread,Jun 20, 2012, 10:47:07 PM6/20/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Erlang China
我的程序在使用SSL的时候报错。希望有清楚的前辈指教。不胜感谢。
错误信息 :
=ERROR REPORT==== 21-Jun-2012::10:31:00 ===
application: mochiweb
"Accept failed error"
"{'EXIT',\n {noproc,\n {gen_server,call,\n
[ssl_connection_sup,\n {start_child,\n
[server,\"localhost\",8000,#Port<0.899>,\n
{{ssl_options,[],verify_none,\n {#Fun<ssl.
1.65541516>,[]},\n false,false,undefined,
1,\n \"/home/ptmind/project/cellant/1.0/
mochiweb/
ebin/ssl.crt\",\n undefined,
\n \"/home/ptmind/project/cellant/1.0/mochiweb/
ebin/wild_ptengine.jp.key\",\n undefined,
[],undefined,\n \"/home/ptmind/project/cellant/
1.0/mochiweb/ebin/ssl.cacrt\",\n
undefined,undefined,\n [<<0,57>>,
\n <<0,56>>,\n <<0,53>>,
\n <<0,22>>,\n <<0,19>>,
\n <<0,10>>,\n <<0,51>>,
\n <<0,50>>,\n <<0,47>>,
\n <<0,5>>,\n <<0,4>>,
\n <<0,21>>,\n <<0,9>>],
\n #Fun<ssl.0.65541516>,true,268435456,false,
[],undefined,\n false},\n
{socket_options,binary,0,0,0,false}},\n <0.51.0>,
\n {gen_tcp,tcp,tcp_closed,tcp_error}]},
\n infinity]}}}"
=ERROR REPORT==== 21-Jun-2012::10:31:00 ===
{mochiweb_socket_server,253,{acceptor_error,{error,accept_failed}}}
我的代码:
start() ->
Conf = [{loop, fun loop/1},
{name, web_server},
{max, 50},
{port, 8000},
{ssl, true},
{ssl_opts, [{cacertfile,"/home/ptmind/project/cellant/1.0/
mochiweb/ebin/ssl.cacrt"},
{certfile,"/home/ptmind/project/cellant/1.0/mochiweb/
ebin/path/to/ssl.crt"},
{keyfile,"/home/ptmind/project/cellant/1.0/mochiweb/
ebin/path/to/wild_pten.jp.key"},
{fail_if_no_peer_cert, true}]}
],
error_logger:info_report({"web_server starts"}),
case catch mochiweb_http:start(Conf) of
{ok, Pid} ->
error_logger:info_report({"mochiweb starts"}),
{ok, Pid};
{_Error, E} ->
error_logger:error_report({"Starting web server failed:",
E}),
{error, E}
end.
我安装的openssl版本:
[root@test-27 ~]# openssl version
OpenSSL 1.0.1c 10 May 2012