4

when I am using this command in my terminal on MacOS terminal showing this error:

curl https://storage.flutter-io.cn/flutter_infra/flutter/0f7cdca65fba5619c02d00bb5faa40a4f1950df7/dart-sdk-darwin-x64.zip
curl: (77) error setting certificate verify locations:
  CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: none
(base)

and I check this path, did not have a certifacate. Then I using this command to check the certificate:

$ curl-config --ca
/usr/local/anaconda3/ssl/cacert.pem

should I using this certificate, how to generate a certificate and make my curl work? Any suggestion?

Dolphin
  • 29,069
  • 61
  • 260
  • 539

1 Answers1

3

If you want to use your curl-config --ca path as cacert path, try this command on bash.

export CURL_CA_BUNDLE=/your/new/cacert/path

For your example, execute this.

export CURL_CA_BUNDLE=/usr/local/anaconda3/ssl/cacert.pem

reference:

How do I deal with certificates using cURL while trying to access an HTTPS url?

ghoul
  • 31
  • 3