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

相关推荐
天庭鸡腿哥21 小时前
国外软件,安装即时专业版!
stm32·microsoft·macos·everything
appleyk1 天前
MacOS-12(Intel) Docker部署Dify1.11.1
macos·docker·agent·dify·dify部署
风为你而吹1 天前
mac m3上使用vscode + platformio开发esp32
ide·vscode·macos
想做后端的小C1 天前
Mac 环境下设置 idea 中的 tomcat 运行配置
macos·tomcat·intellij-idea
转战英雄枫2 天前
Mac上打开安卓虚拟机BlueStacks Air闪退问题解决
macos·bluestacks
liliangcsdn2 天前
mac m1安装homebrew和iterm2示例
macos
墨&白.2 天前
如何卸载/更新Mac上的R版本
开发语言·macos·r语言
游戏开发爱好者82 天前
苹果 App 上架流程,结合 Xcode、CI 等常见工具
macos·ios·ci/cd·小程序·uni-app·iphone·xcode
科技智驱2 天前
Mac废纸篓清空的东西能还原吗?找回Mac废纸篓数据的教程
macos·数据恢复
猫头虎3 天前
GoLand 2025.3 最新变化:值得更新吗?
ide·windows·macos·pycharm·编辑器·intellij-idea·idea