【发布时间】:2019-05-26 12:37:14
【问题描述】:
我有以下问题:
灵药
[centos@ip-172-172-3-49 helix]$ env MIX_ENV=prod mix release
Could not find Hex, which is needed to build dependency :plug_cowboy
Shall I install Hex? (if running non-interactively, use "mix local.hex --force") [Yn] Y
18:12:32.462 [info] ['TLS', 32, 'client', 58, 32, 73, 110, 32, 115, 116, 97, 116, 101, 32, 'hello', 32, 'received SERVER ALERT: Fatal - Handshake Failure', 10]
** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {'repo.hex.pm', 443}}, {:inet6, [:inet6], :enetunreach}, {:inet, [:inet], {:tls_alert, 'handshake failure'}}]}
Could not install Hex because Mix could not download metadata at https://repo.hex.pm/installs/hex-1.x.csv.
我猜根本原因是 Erlang 的原因
Erlang/OTP 21 [erts-10.2.1] [source] [64-bit] [smp:36:36] [ds:36:36:10] [async-threads:1] [hipe]
1> ssl:start().
ok
2> Sock = fun() -> {ok, S} = gen_tcp:connect("google.com", 443, []), S end.
#Fun<erl_eval.20.128620087>
3> ssl:connect(Sock(), []).
=INFO REPORT==== 28-Dec-2018::18:10:30.019612 ===
TLS client: In state hello received SERVER ALERT: Fatal - Handshake Failure
{error,{tls_alert,"handshake failure"}}
目前有解决方法吗?操作系统是 Centos 7。
更新1
在 MacOS 上有效:
Erlang/OTP 21 [erts-10.2] [source] [64-bit] [smp:6:6] [ds:6:6:10] [async-threads:1] [hipe] [dtrace]
Eshell V10.2 (abort with ^G)
1> ssl:start().
ok
2> Sock = fun() -> {ok, S} = gen_tcp:connect("google.com", 443, []), S end.
#Fun<erl_eval.20.128620087>
3> ssl:connect(Sock(), []).
{ok,{sslsocket,{gen_tcp,#Port<0.6>,tls_connection,undefined},
[<0.100.0>,<0.99.0>]}}
4>
【问题讨论】:
-
您的服务器是否可能没有适当的 CA 证书?常规 curl 命令是否有效?
curl https://google.com? -
我将范围缩小到我正在使用的 Erlang RPM。另一个 Erlang 安装工作得很好。