MacOS下更新curl

苹果自带的curl不支持Https,我们可以通过curl -V看到如下结果

curl 7.72.0 (x86_64-apple-darwin18.6.0) libcurl/7.72.0 zlib/1.2.12 libidn2/2.3.7 librtmp/2.3

Release-Date: 2020-08-19

Protocols: dict file ftp gopher http imap ldap ldaps pop3 rtmp rtsp smtp telnet tftp

从上面的Protocols里面也可以看到不支持https,如果我们执行下面这个命令

curl https://www.baidu.com/ -vvvv

会出现如下报错:

curl: (1) Protocol "https" not supported or disabled in libcurl

现在需要升级curl,主要通过brew进行安装,执行如下命令

复制代码
brew install curl

会出现如下结果

按照提示还需要设置环境变量PATH,否则会不生效,按照上面的提示,执行如下命令:

export PATH="/usr/local/opt/curl/bin:$PATH"

这个时候我们再执行curl -V,可以看到如下结果

curl 8.8.0 (x86_64-apple-darwin23.4.0) libcurl/8.8.0 (SecureTransport) OpenSSL/3.3.1 zlib/1.2.12 brotli/1.1.0 zstd/1.5.6 libidn2/2.3.7 libssh2/1.11.0 nghttp2/1.61.0 librtmp/2.3 OpenLDAP/2.6.8

Release-Date: 2024-05-22

Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp

Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz MultiSSL NTLM SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd

可以看到新增了很多协议。至此升级完成

再执行curl https://www.baidu.com/ -vvvv可以看到如下结果

相关推荐
aosky20 小时前
手机远程畅玩OpenAI Codex
macos·智能手机·cocoa
A懿轩A1 天前
【2026 最新】Python 下载与安装:在 macOS 下使用 Homebrew 和 pyenv 完美管理多版本 Python
python·macos·mac
IKaros_α‌1 天前
mac上安装openclaw从入门到删除
macos
x-cmd1 天前
macOS 内存模型深度解析 | x free 设计哲学
linux·macos·内存·策略模式·free·x-cmd
itinymeng1 天前
在 macOS 上遇到 brew: command not found 错误,通常是因为 ‌Homebrew 未安装‌ 或 ‌PATH 环境变量未正确配置‌
macos
oscar9991 天前
Claude Code 的“计算机使用”功能:让命令行助手真正操控macOS桌面
macos·claude code·computer
老兵发新帖2 天前
软件开发国内常用镜像源配置及回退方法(MAC版)
macos·软件工程
qq_411262422 天前
ESP32-C5 软件配置MAC 地址
macos
鸠摩智首席音效师2 天前
如何在 MacOS 上安装 PostgreSQL ?
数据库·macos·postgresql
花千树-0102 天前
IndexTTS2 在 macOS 性能最佳设置(M1/M2/M3/M4 全适用)
人工智能·深度学习·macos·ai·语音识别·ai编程