4

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

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

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

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. My task is to make it work on Mac.

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.

Thank you.

Yevgeniy Afanasyev
  • 37,872
  • 26
  • 173
  • 191

1 Answers1

1

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
pHiL
  • 1,722
  • 18
  • 19
  • can you line out where to set this paths? I do not understand the topic where to do it and what is to do... – novski Jun 19 '18 at 19:29
  • @novski to permanently set the `PATH` variable, add it to your shells rc file. that might be `~/.zshrc` or more standard/likely`~/.bashrc` if you need openssl in some software project you want to build, you have to set the `LDFLAGS` `CPPFLAGS` and maybe `PKG_CONFIG_PATH` in the build tool. otherwise ignore them – pHiL Jun 20 '18 at 13:37