该代码在 Ubuntu vagrant box 上运行良好,但在本地 MacO 上它不会加载证书,说
cURL error 58: SSL: Can't load the certificate "..." and its private key: OSStatus -25299
我研究过 Mac 有一个支持 OS X 本机 API 而不是 OpenSSL 的点。
我需要转换一个证书+PEM to pkcs12像那样。
openssl pkcs12 -export -in ./client.crt -inkey ./client.pem -out client.p12
但这对我不起作用,因为我的 PHP 服务器在 Ubuntu 上,我不想破坏正在运行的功能。我的任务是让它在 Mac 上运行。
我宁愿安装带有 openssl 支持的curl。我试过这个:
$ brew uninstall curl
$ brew install curl --with-openssl
$ brew link curl --force
$ curl --version
但这并没有解决问题。
请告诉我我做错了什么。
谢谢。
通过brew安装curl并使用问题中概述的openssl支持是正确的方法。但是您需要从其安装目录中显式调用它/usr/local/opt/curl/bin/curl -v -k --key..
正如安装时所述,brew 不会将其链接到 /usr/local
This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have this software first in your PATH run:
echo 'export PATH="/usr/local/opt/curl/bin:$PATH"' >> ~/.zshrc
For compilers to find this software you may need to set:
LDFLAGS: -L/usr/local/opt/curl/lib
CPPFLAGS: -I/usr/local/opt/curl/include
For pkg-config to find this software you may need to set:
PKG_CONFIG_PATH: /usr/local/opt/curl/lib/pkgconfig
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)