简体   繁体   English

cURL错误58:SSL:无法加载证书“...”及其私钥:Mac上的OSStatus -25299

[英]cURL error 58: SSL: Can't load the certificate “…” and its private key: OSStatus -25299 on Mac

The code is working fine on Ubuntu vagrant box, but on local MacOs it does not load sertificates saying 代码在Ubuntu vagrant box上工作正常,但在本地MacO上它没有加载sertificates说

cURL error 58: SSL: Can't load the certificate "..." and its private key: OSStatus -25299

I researched that Mac has a point of supporting the OS X native API instead of OpenSSL. 我研究过Mac有一点支持OS X本机API而不是OpenSSL。

And I need to convert a pem + cert to pkcs12 like that. 我需要将pem + cert转换为pkcs12

openssl pkcs12 -export -in ./client.crt -inkey ./client.pem -out client.p12

But this is not working for me because my PHP server is on Ubuntu and I don't want to break what is working. 但这对我不起作用,因为我的PHP服务器在Ubuntu上,我不想破坏正常工作。 My task is to make it work on Mac. 我的任务是让它在Mac上运行。

I would rather install curl with openssl support. 我宁愿用openssl支持安装curl。 I tried this: 我试过这个:

$ brew uninstall curl
$ brew install curl --with-openssl
$ brew link curl --force
$ curl --version

But it did not solve the problem. 但它并没有解决问题。

Please tell me what am I did wrong. 请告诉我我做错了什么。

Thank you. 谢谢。

installing curl via brew and with openssl support as outlined in the question is the correct approach. 如问题中所述,通过brew安装curl并使用openssl支持是正确的方法。 however you need to explicitly call it from its install dir /usr/local/opt/curl/bin/curl -v -k --key.. as brew wont link it to /usr/local as stated on install 但是你需要从它的安装目录/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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM