phoenixframework / tailwind

An installer for tailwind
MIT License
467 stars 61 forks source link

Tailwind download doesn't honor custom certificate settings #81

Closed yonkeltron closed 1 year ago

yonkeltron commented 1 year ago

Hello,

First off I just wanted to start by saying how great this project seems and how grateful I am for your efforts in putting things together. Thank you.

Weirdly, the corporate proxy at work is getting in the way of me using this project because the tailwind settings don't seem to honor the :cacert_path config key as esbuild does.

In particular, I get the following error when trying to run a mix tailwind.install on macOS:

16:22:40.417 [notice] TLS :client: In state :wait_cert_cr at ssl_handshake.erl:2098 generated CLIENT ALERT: Fatal - Unknown CA

** (RuntimeError) couldn't fetch https://github.com/tailwindlabs/tailwindcss/releases/download/v3.2.4/tailwindcss-macos-arm64: {:error, {:failed_connect, [{:to_address, {'github.com', 443}}, {:tls, [server_name_indication: 'github.com', verify: :verify_peer, cacertfile: '/path/to/project/_build/dev/lib/castore/priv/cacerts.pem', depth: 2, customize_hostname_check: [match_fun: #Function<6.29392970/2 in :public_key.pkix_verify_hostname_match_fun/1>], versions: [:"tlsv1.2", :"tlsv1.3"]], {:tls_alert, {:unknown_ca, 'TLS client: In state wait_cert_cr at ssl_handshake.erl:2098 generated CLIENT ALERT: Fatal - Unknown CA\n'}}}]}}
    lib/tailwind.ex:329: Tailwind.fetch_body!/1
    lib/tailwind.ex:230: Tailwind.install/0
    (mix 1.13.4) lib/mix/task.ex:397: anonymous fn/3 in Mix.Task.run_task/3
    (mix 1.13.4) lib/mix/cli.ex:84: Mix.CLI.run_task/2 

Is there any other information we can provide? Happy to provide additional detail and lend a hand to test solutions.

Thanks, +Jonathan

josevalim commented 1 year ago

This feature is now available in 0.1.10.