Skip to content

Instantly share code, notes, and snippets.

@sinwoobang
Last active September 23, 2024 02:41
Show Gist options
  • Save sinwoobang/c83af540a2df8b149a59007e5f5814ec to your computer and use it in GitHub Desktop.
Save sinwoobang/c83af540a2df8b149a59007e5f5814ec to your computer and use it in GitHub Desktop.
Install curl supporting HTTP/3 on Apple Silicon
# Referred to https://dev.to/gjrdiesel/installing-curl-with-http3-on-macos-2di2
# Clean up any old version of curl you may have already tried to install
brew remove -f curl
# Download the curl ruby install script provided by cloudflare
curl -O https://gist.githubusercontent.com/sinwoobang/bfc7cc8d4d38157bde064fc2ccb60c64/raw/bf55b7c6af9ed06d2cd909ea167a69948a800e7d/curl.rb
# Install curl via that script from the latest git repos
brew install --HEAD -s curl.rb
# Tell your cli to use the curl version just installed (if you're using zsh, othwerise you might need `~/.bashrc`)
echo 'export PATH="/opt/homebrew/opt/curl/bin:$PATH"' >> ~/.zshrc
# Reload your config
source ~/.zshrc
# Double check it's using the right curl
which curl # Should output "/opt/homebrew/opt/curl/bin/curl"
# Double check http3
curl --version | grep HTTP3
# Try curl on any HTTP/3 enabled sites.
curl --http3 https://blog.cloudflare.com -I
@Agnibho-8
Copy link

I am facing the following error

Error: Failed to load cask: curl.rb
Cask 'curl' is unreadable: wrong constant name #Class:0x000000013819e630
Warning: Treating curl.rb as a formula.

@hexeater
Copy link

hexeater commented May 6, 2024

Errors out....

==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
HEAD is now at 46d7214ca tls: Remove EXAMPLEs from deprecated options
==> cargo build --release --package=quiche --features=ffi,pkg-config-meta,qlog
==> ./buildconf
==> ./configure --disable-silent-rules --with-ssl=/private/tmp/curl-20240506-73413-fr7s00/quiche/quiche/deps/boringssl/src --with
Last 15 lines from /Users/joe/Library/Logs/Homebrew/curl/03.configure:
checking whether to support the MIME API... yes
checking whether to support binding connections locally... yes
checking whether to support the form API... yes
checking whether to support date parsing... yes
checking whether to support netrc parsing... yes
checking whether to support progress-meter... yes
checking whether to support DNS shuffling... yes
checking whether to support curl_easy_option*... yes
checking whether to support alt-svc... yes
checking whether to support headers-api... yes
checking whether to support HSTS... yes
checking for SSL_set0_wbio... yes
checking whether to support WebSockets... no
checking whether hiding of library internal symbols will actually happen... yes
configure: error: MultiSSL cannot be enabled with HTTP/3 and vice versa

@sinsonglew
Copy link

Errors out....

==> Checking out branch master Already on 'master' Your branch is up to date with 'origin/master'. HEAD is now at 46d7214ca tls: Remove EXAMPLEs from deprecated options ==> cargo build --release --package=quiche --features=ffi,pkg-config-meta,qlog ==> ./buildconf ==> ./configure --disable-silent-rules --with-ssl=/private/tmp/curl-20240506-73413-fr7s00/quiche/quiche/deps/boringssl/src --with Last 15 lines from /Users/joe/Library/Logs/Homebrew/curl/03.configure: checking whether to support the MIME API... yes checking whether to support binding connections locally... yes checking whether to support the form API... yes checking whether to support date parsing... yes checking whether to support netrc parsing... yes checking whether to support progress-meter... yes checking whether to support DNS shuffling... yes checking whether to support curl_easy_option*... yes checking whether to support alt-svc... yes checking whether to support headers-api... yes checking whether to support HSTS... yes checking for SSL_set0_wbio... yes checking whether to support WebSockets... no checking whether hiding of library internal symbols will actually happen... yes configure: error: MultiSSL cannot be enabled with HTTP/3 and vice versa

you have to update this line of curl.rb , then retry:

--with-ssl=#{quiche}/deps/boringssl/src -> --with-openssl=#{quiche}/deps/boringssl/src

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment