我在Mac OS X 10上使用终端。11.2,我不能处理任何https请求。我总是得到这个错误:
curl: (1) Protocol "https" not supported or disabled in libcurl
我尝试了这个,但我得到了一个“错误目录”错误:
./configure --with-ssl=/usr/local/ssl
任何建议都会有帮助。
编辑:
这是我在尝试使用ssl安装时遇到的错误:
configure: error: OpenSSL libs and/or directories were not found where specified!
解决方案:
适用于Mac OS X 10。6或更高版本使用此选项来启用SSL:
./configure --with-darwinssl
7条答案
按热度按时间j13ufse21#
Homebrew团队最近删除了cURL公式的所有安装选项,这意味着你现在将无法执行
brew install curl --with-openssl
。相反,执行brew install curl-openssl
。请确保先卸载旧的brew uninstall curl
。wztqucjr2#
以下步骤有助于解决问题:(注意:libcurl将被重建)
如果没有修复,下载并重建libcurl,按照以下步骤,这帮助我修复了这个问题
hmae6n7t3#
解决方案:
适用于Mac OS X 10。6或更高版本使用此选项来启用SSL:
llmtgqce4#
通过将标准curl替换为支持nghttp2的curl解决了这个问题(需要brew)
包括
--http2
例如:
或:
参考:https://daniel.haxx.se/blog/2016/08/01/curl-and-h2-on-mac/https://simonecarletti.com/blog/2016/01/http2-curl-macosx/
qltillow5#
我犯了一个新手错误,把URL加在引号中(curl -v -k“https://URL.com“)。将链接放入撇号(curl -v -k 'https://URL.com')后,curl接受了https URL。
zour9fqk6#
对于任何在2021年以及之后使用Xcode 12+尝试通过命令行构建项目并且不想依赖'brew'或其他包管理器的人来说。..
我在从github获得curl源代码后遇到了
./configure: No such file or directory
问题。来自github的源代码缺少configure exec。你需要生成你的makefile
Apple在其开源浏览器中提供了curl源沿着所需的MacOS/iOS构建设置:
https://opensource.apple.com/source/curl/
https://opensource.apple.com/release/macos-112.html
1.下载并解压缩源代码
1.设置你的环境变量-Apple Platforms (macOS, iOS, tvOS, watchOS, and their simulator counterparts)
export ARCH=arm64
export SDK=iphoneos
export DEPLOYMENT_TARGET=11.0
export CFLAGS="-arch $ARCH -isysroot $(xcrun -sdk $SDK --show-sdk-path) -m$SDK-version-min=$DEPLOYMENT_TARGET"
1.运行:
./configure --with-darwinssl
我的用例是在Azure DevOps中的托管macOS构建代理上构建iOS应用程序
6uxekuva7#
Ventura在2023年的更新解决方案。首先你要安装openssl,然后用brew安装curl:
然后,您需要将安装的
curl
版本导出到zsh
或您使用的任何shell,并使用以下命令(如果在英特尔上运行,请将路径更改为/usr/local
):然后用
curl -V
检查可用的协议,你应该会看到https,sftp等。