Can't install hex as httpc request failed

If your question is related to Phoenix or Nerves, please post it in the Phoenix or Nerves Questions / Help section. Thanks!

when I run

mix local.hex

I get this error :

18:11:47.975 [info]  TLS client: In state certify at tls_connection.erl:1192 generated CLIENT ALERT: Fatal - Handshake Failure - malformed_handshake_data

** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {'repo.hex.pm', 443}}, {:inet, [:inet], {:tls_alert, {:handshake_failure, 'TLS client: In state certify at tls_connection.erl:1192 generated CLIENT ALERT: Fatal - Handshake Failure - malformed_handshake_data\n'}}}]}

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

what should I do ?

I really don’t get what happen behind the scenes, but upgrading Erlang with brew solved the issue.

Just ran brew upgrade erlang which installed 22.1.3.

If ever someone have further explanations about what caused the issue, I’ll be happy to read about it.

But I’m happy anyway. It works now ! :smiley:

1 Like

It’s hard to say without knowing the Erlang version you used when the error occurred. It might have been ERL-968, if you were previously on 22.0.x (where x < 4) or one of the affected 21.3 versions. I haven’t seen that issue affect Hex, and the error message is different from the original report, but both can be explained by an unusual path MTU between you and the Hex server.

2 Likes

thank you @voltone ! I was indeed on 22.0.x, so that is likely to be the problem.