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

相关推荐
刘婉晴9 小时前
【漏扫工具篇】Mac 系统上 Xray 的安装与使用
macos
寒水馨1 天前
macOS下载、安装PowerShell-v7.6.4(附安装包powershell-7.6.4-osx-arm64.pkg)
macos·自动化·跨平台·shell·脚本·命令行·powershell
星辰即远方2 天前
天气预报总结
macos·ios·objective-c·cocoa
xixiaoyunya2 天前
Mac远程访问新范式:基于80KM穿云箭的内网穿透技术实践
macos
秋雨梧桐叶落莳2 天前
计算器仿写总结
学习·macos·ios·objective-c·cocoa
寒水馨2 天前
macOS下载、安装uv-0.12.0(附安装包uv-aarch64-apple-darwin.tar.gz)
python·macos·rust·项目管理·包管理器·astral·pip替代
寒水馨2 天前
macOS下载、安装protobuf-v35.1(附安装包protoc-35.1-osx-universal_binary.zip)
macos·google·grpc·序列化·protobuf·protoc·数据交换
寒水馨2 天前
macOS下载、安装ripgrep-15.2.0(附安装包ripgrep-15.2.0-aarch64-apple-darwin.tar.gz)
macos·正则表达式·rust·ripgrep·rg·命令行搜索·代码搜索
起司喵喵3 天前
Flutter-MacOS桌面OS系统|flutter.+window_manager客户端OS模板
flutter·macos·策略模式
代码对我眨眼睛3 天前
macOS Google Chrome 常用快捷键
前端·chrome·macos