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可以看到如下结果

相关推荐
无意feel1 天前
MacOS 安装neofetch cmatrix lolcat
macos·数字雨·彩虹特效
KevinShi_BJ1 天前
MacOS 上安装 Docker 和启动 LangBot
macos
ricky_fan1 天前
(25年12月)claude code报错:might not be available in your country
macos·bash
james bid1 天前
MacBook Pro 2015 上 XUbuntu 24.04 启用 eGPU (GeForce GTX 1080 Ti) 和核显黑屏问题解决
linux·ubuntu·macos·cuda·egpu
私人珍藏库1 天前
[Mac] Mac风扇控制软件 iFan V1.1.1
macos
腾讯云qcloud07551 天前
腾讯位置商业授权iOS 轨迹SDK
macos·ios·cocoa
新手村领路人1 天前
MacOS Tahoe26.1自制定时休眠app
macos
2501_916007471 天前
没有 Mac,如何在 Windows 上架 iOS 应用?一套可落地的工程方案
android·macos·ios·小程序·uni-app·iphone·webview
乐之者v2 天前
mac操作快捷键命令
macos
一步徐龙的浪2 天前
Scholaread Mac版更新后无法用手机验证码登录
macos·scholaread·靠岸学术