Erlang 无法连接到任何 HTTPS url
Erlang can't connect to any HTTPS url
当我尝试构建 rebar3 时出现问题,但它无法从 Amazon S3 获取其依赖项。调试问题我发现 erlang 运行时无法连接到任何 HTTPS 站点,尽管 curl 或 wget 工作得很好。当我设置 httpc:set_options([{verbose,trace}])
时,我得到以下输出:
{failed_connect,
[{to_address,{"s3.amazonaws.com",443}},
{inet,
[inet],
{eoptions,
{undef,
[{ssl,connect,
["s3.amazonaws.com",443,
[binary,
{active,false},
{ssl_imp,new},
inet],
20000],
[]},
{http_transport,connect,4,
[{file,"http_transport.erl"},{line,135}]},
{httpc_handler,connect,4,
[{file,"httpc_handler.erl"},{line,891}]},
{httpc_handler,
connect_and_send_first_request,3,
[{file,"httpc_handler.erl"},{line,905}]},
{httpc_handler,init,1,
[{file,"httpc_handler.erl"},{line,242}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,239}]}]}}}]}
我在哪里可以找到问题所在?
您缺少 ssl Erlang 应用程序。一些 Linux 发行版将 Erlang 分成几个子包。您应该确保您的系统上安装了软件包 erlang-ssl
。
当我尝试构建 rebar3 时出现问题,但它无法从 Amazon S3 获取其依赖项。调试问题我发现 erlang 运行时无法连接到任何 HTTPS 站点,尽管 curl 或 wget 工作得很好。当我设置 httpc:set_options([{verbose,trace}])
时,我得到以下输出:
{failed_connect,
[{to_address,{"s3.amazonaws.com",443}},
{inet,
[inet],
{eoptions,
{undef,
[{ssl,connect,
["s3.amazonaws.com",443,
[binary,
{active,false},
{ssl_imp,new},
inet],
20000],
[]},
{http_transport,connect,4,
[{file,"http_transport.erl"},{line,135}]},
{httpc_handler,connect,4,
[{file,"httpc_handler.erl"},{line,891}]},
{httpc_handler,
connect_and_send_first_request,3,
[{file,"httpc_handler.erl"},{line,905}]},
{httpc_handler,init,1,
[{file,"httpc_handler.erl"},{line,242}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,239}]}]}}}]}
我在哪里可以找到问题所在?
您缺少 ssl Erlang 应用程序。一些 Linux 发行版将 Erlang 分成几个子包。您应该确保您的系统上安装了软件包 erlang-ssl
。