Handshake failure with mix local.hex

, ,

Hello,

I’ve just installed Erlang and Elixir using asdf and am attempting to pull down the dependencies of a project I’m on. After running mix deps.get I get the error below.

git:(master) ✗ mix deps.get
Could not find Hex, which is needed to build dependency :jason
Shall I install Hex? (if running non-interactively, use "mix local.hex --force") [Yn] Y
** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {'repo.hex.pm', 443}}, {:inet, [:inet], {:tls_alert, {:handshake_failure, 'TLS client: In state hello received SERVER ALERT: Fatal - Handshake Failure\n'}}}]}

Could not install Hex because Mix could not download metadata at https://repo.hex.pm/installs/hex-1.x.csv.

Alternatively, you can compile and install Hex directly with this command:

    mix archive.install github hexpm/hex branch latest

I’m able to curl repo.hex.pm so I’m not sure why the hex command is having issues.

I’m on MacOS monterey 12.0.1
Erlang 24.2
Elixir 1.13.2-otp-24

openssl version - LibreSSL 2.8.3

Any help would be greatly appreciated

Were you able to resolve the issue?

I had a similar one just recently when upgrading to Elixir 1.13 and found a solution here. I think the OpenSSL version might be the issue here.

Yes and the solution was essentially the same. With asdf I uninstalled my erlang build and rebuilt it making sure the KERL_CONFIGURE_OPTIONS environment variable included the --with-ssl option and was pointing to the correct openssl installation; 1.1 in my instance.

KERL_CONFIGURE_OPTIONS="--without-javac --with-ssl=/usr/local/opt/openssl@1.1"

1 Like