Hex failing to install on Windows 10 VM (CA error)

Followed the Windows install instructions but am not able to get Hex installed.

I do not have this issue on my main Ubuntu machine but only within the Windows 10 virtual machine.

> mix test                                                                 
Mix requires the Hex package manager to fetch dependencies
Shall I install Hex? (if running non-interactively, use "mix local.hex --force") [Yn]
** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {~c"builds.hex.pm", 443}}, {:inet, [:inet], {:tls_alert, {:unknown_ca, ~c"TLS client: In state wait_cert_cr at ssl_handshake.erl:2133 generated CLIENT ALERT: Fatal - Unknown CA\n"}}}]}                                                                                                                                                                                                                                   Could not install Hex because Mix could not download metadata at https://builds.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                                                                                                                                   

Versions:

> elixir --version
Erlang/OTP 26 [erts-14.2.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns]                                                                                                                                                  Elixir 1.16.0 (compiled with Erlang/OTP 26)  

Windows 10 build: 19045.3930

A quick fix might be to run mix hex.config unsafe_https true

I ended up running mix archive.install github hexpm/hex branch latest which worked.

Nevermind, broken again…

> mix deps.get
...
telemetry_metrics 0.6.1
telemetry_poller 1.0.0
websock 0.5.3
websock_adapter 0.5.4
** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {~c"builds.hex.pm", 443}}, {:inet, [:inet], {:tls_alert, {:unknown_ca, ~c"TLS client: In state wait_cert_cr at ssl_handshake.erl:2133 generated CLIENT ALERT: Fatal - Unknown CA\n"}}}]}
Could not install Rebar because Mix could not download metadata at https://builds.hex.pm/installs/rebar3-1.x.csv.                                                                       

mix hex.config unsafe_https true did not resolve the problem but thanks for the suggestion.

Try this?

apt install ca-certificates