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

相关推荐
FreeBuf_18 小时前
高度复杂的macOS DigitStealer采用多阶段攻击逃避检测
macos·m2芯片
ai_xiaogui1 天前
Mac苹果版Krita AI一键安装教程:AIStarter+ComfyUI零基础部署全流程(X86/ARM双架构)
arm开发·人工智能·macos·comfyui·一键部署·ai绘画教程·kritaai
晚枫~1 天前
不同浏览器在Windows和Mac上的跨域配置方法
windows·macos
denggun123452 天前
Xcode的App Thinning Size Report分析包体积
macos·蓝桥杯·xcode
醇氧2 天前
MAC安装 Notepad Next
macos
我的golang之路果然有问题3 天前
mac配置 unity+vscode的坑
开发语言·笔记·vscode·macos·unity·游戏引擎
alanesnape3 天前
Mac 目录树结构与基础 Linux 指令指南
macos
Digitally3 天前
解决“Move to iOS 卡在准备中”的 9 种有效方法
macos·ios·cocoa
影魅周影3 天前
解决mac端pycharm执行allure命令报错:returned non-zero exit status 127
ide·macos·pycharm
2501_927541093 天前
CameraBag Mac英文 照片视频滤镜编辑工具
macos