cURL错误58:SSL:无法加载证书"...".及其私钥:Mac上的OSStatus -25299 [英] cURL error 58: SSL: Can't load the certificate "..." and its private key: OSStatus -25299 on Mac

查看:364
本文介绍了cURL错误58:SSL:无法加载证书"...".及其私钥:Mac上的OSStatus -25299的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该代码在Ubuntu vagrant盒上运行良好,但是在本地MacO上它不会加载说明

The code is working fine on Ubuntu vagrant box, but on local MacOs it does not load sertificates saying

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

我研究过Mac具有支持OS X本机API而非OpenSSL的意义.

I researched that Mac has a point of supporting the OS X native API instead of OpenSSL.

我需要像这样将 pem +证书转换为 pkcs12 .

And I need to convert a pem + cert to pkcs12 like that.

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

但这对我不起作用,因为我的PHP服务器在Ubuntu上,并且我不想破坏正在运行的功能.我的任务是使其在Mac上运行.

But this is not working for me because my PHP server is on Ubuntu and I don't want to break what is working. My task is to make it work on Mac.

我宁愿在带有openssl支持的地方安装curl.我试过了:

I would rather install curl with openssl support. 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.

谢谢.

推荐答案

通过brew并在问题中概述的openssl支持下安装curl是正确的方法.但是您需要从其安装目录/usr/local/opt/curl/bin/curl -v -k --key..中明确调用它,因为brew不会按照安装说明将其链接到/usr/local

installing curl via brew and with openssl support as outlined in the question is the correct approach. 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

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

这篇关于cURL错误58:SSL:无法加载证书"...".及其私钥:Mac上的OSStatus -25299的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆