root@sclrdev:/home/sclr/certs/FreshCerts# curl --ftp-ssl --verbose ftp://{abc}/ -u trup:trup --cacert /etc/ssl/certs/ca-certificates.crt
* About to connect() to {abc
It is most likely a missing cert from the server.
Root->Intermediate->Server
A server should send the Server & Intermediate as a minimum.
Use openssl s_client -showcerts -starttls ftp -crlf -connect abc:21
to debug the issue.
If only one cert is returned (either self signed, or issued), then you must choose to either:
curl -k
(very bad idea)If the server returned, more than one, but not including a self signed (root) cert:
If the server returned a root CA certificate, then it is not in your CA store, your options are:
I have ignored expired / revoked certs because there were no messages indicating it. But you can examine the certs with openssl x509 -text
Given you are connecting to a home edition (https://www.cerberusftp.com/support/help/installing-a-certificate/) ftp server, I am going to say it is self signed.
Please post more details, like the output from openssl.
this can help you for guzzle :
$client = new Client(env('API_HOST'));
$client->setSslVerification(false);
tested on guzzle/guzzle 3.*
We ran into this error recently. Turns out it was related to the root cert not being installed in the CA store directory properly. I was using a curl command where I was specifying the CA dir directly. curl --cacert /etc/test/server.pem --capath /etc/test ...
This command was failing every time with curl: (60) SSL certificate problem: unable to get local issuer certificate.
After using strace curl ...
, it was determined that curl was looking for the root cert file with a name of 60ff2731.0, which is based on an openssl hash naming convetion. So I found this command to effectively import the root cert properly:
ln -s rootcert.pem `openssl x509 -hash -noout -in rootcert.pem`.0
which creates a softlink
60ff2731.0 -> rootcert.pem
curl, under the covers read the server.pem cert, determined the name of the root cert file (rootcert.pem), converted it to its hash name, then did an OS file lookup, but could not find it.
So, the takeaway is, use strace when running curl when the curl error is obscure (was a tremendous help), and then be sure to properly install the root cert using the openssl naming convention.
According to cURL docs you can also pass the certificate to the curl
command:
Get a CA certificate that can verify the remote server and use the proper option to point out this CA cert for verification when connecting. For
libcurl
hackers:curl_easy_setopt(curl, CURLOPT_CAPATH, capath);
With the curl command line tool:
--cacert [file]
For example:
curl --cacert mycertificate.cer -v https://www.stackoverflow.com
Had this problem after install Git Extensions v3.48. Tried to install mysysgit again but same problem. At the end, had to disable (please consider security implications!) Git SSL verification with:
git config --global http.sslVerify false
but if you have a domain certificate better add it to (Win7)
C:\Program Files (x86)\Git\bin\curl-ca-bundle.crt
Specifically for Windows
users, using curl-7.57.0-win64-mingw
or similar version.
This is a bit late, and the existing answers are correct. But I still had to struggle a bit to get it working on my Windows machine, though the process is actually pretty straight forward. So, sharing the step-by-step process.
This error basically means, curl is failing to verify the certificate of the target URI. If you trust the issuer of the certificate (CA), you can add that to the list of trusted certificates.
For that, browse the URI (e.g. on Chrome) and follow the steps
.cer
file and copy the contents (including -----BEGIN CERTIFICATE----- and -----END CERTIFICATE-----)curl.exe
is saved e.g. C:\SomeFolder\curl-7.57.0-win64-mingw\bin
curl-ca-bundle.crt
file with a text editorNow your command should execute fine in curl.