Fix Curl Error 60 by giving curl a valid CA bundle, not by turning SSL checks off. Curl Error 60 means curl cannot prove the server certificate is trusted, often shown as “SSL certificate problem: unable to get local issuer certificate” [source: curl].
TLDR: Curl Error 60 is usually not a “bad internet” problem. It is a trust problem. For example, one developer may have 42 API calls fail after moving a PHP app to a new Windows laptop because curl cannot find the CA file. The sane fix is to install or point curl to a current CA bundle, such as cacert.pem, then retry the request.
What Curl Error 60 really means
Curl is strict about HTTPS. That is good. Annoying, yes. But good.
When curl connects to an HTTPS site, it checks the site’s certificate. It asks a simple question:
“Can I trust this certificate chain?”
If the answer is no, curl stops. Then you get Error 60.
This may happen even when the same URL works fine in Chrome or Firefox. That feels unfair. It drives me crazy that a browser can smile at the site while curl screams in the terminal. But they may use different trust stores. Your browser has one list of trusted certificate authorities. Curl may use another.
Curl certificate validation vs CA bundle configuration
These two things sound similar. They are not the same.
- Certificate validation is the security check. Curl verifies the site certificate, issuer, dates, hostname, and chain.
- CA bundle configuration tells curl where to find trusted root certificates.
Think of curl as a bouncer at a club.
The web server shows an ID. That ID is the SSL certificate. Curl checks if the ID was issued by someone trusted. The CA bundle is curl’s list of trusted issuers. If curl has no list, or the list is old, the bouncer panics.
The server might be fine. The certificate might be fine. Your CA bundle may be missing, outdated, or ignored.
Common causes of Curl Error 60
Most Error 60 cases come from boring setup issues. Sorry. No dramatic hacker movie scene here.
- Missing CA bundle: Curl has no trusted root certificate file.
- Old CA bundle: The site uses a newer chain curl does not know.
- Wrong path: Your app points to a CA file that does not exist.
- Corporate proxy: A company firewall replaces certificates with its own.
- Self signed certificate: Common in local dev and private APIs.
- Broken server chain: The server forgot to send an intermediate certificate.
Expect to waste time on path issues. One missing slash can cost 20 minutes and a cup of coffee.
The bad fix: turning SSL verification off
You will see this fix online:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
Or this on the command line:
curl -k https://example.com
Yes, it works. It also removes the main safety check from HTTPS.
That means curl may accept a fake certificate. It could talk to the wrong server. It could expose tokens, passwords, private API data, and payment details.
Use -k only for a quick test. Use it like a fire alarm test button. Do not build your house around it.
The good fix: install or update the CA bundle
The clean fix is simple:
- Get a fresh CA bundle.
- Put it somewhere stable.
- Tell curl, PHP, Git, or your app where it is.
- Try the request again.
For many setups, the CA bundle file is called cacert.pem. The curl project points users to a CA extract based on Mozilla’s trusted roots. Save it in a folder you will not delete next week.
On Windows, a common location is:
C:\certs\cacert.pem
On Linux or macOS, the system CA store is often already installed. But containers and minimal images can be bare. Tiny Docker images are cute until HTTPS fails in 0.8 seconds.
Fixing Curl Error 60 in PHP
PHP apps hit this error a lot. Especially on Windows with local tools like XAMPP, WAMP, or Laragon.
First, download or place cacert.pem somewhere safe. Then edit your php.ini file.
Add or update this line:
curl.cainfo = "C:\certs\cacert.pem"
You may also set:
openssl.cafile = "C:\certs\cacert.pem"
Restart your web server after saving. That part matters. PHP will not magically reload the file because you stared at it with hope.
Then test again.
var_dump(curl_version());
Check that your app is using the PHP version you edited. Many machines have several PHP installs. The terminal may use one. Apache may use another. Your editor may point to a third. Fun, right?
Fixing Curl Error 60 with command line curl
You can test a CA bundle directly:
curl --cacert C:\certs\cacert.pem https://example.com
On macOS or Linux:
curl --cacert /etc/ssl/certs/ca-certificates.crt https://example.com
If that works, curl trusts the site when given the right CA file. Now make the setting permanent in your app or environment.
You can also set an environment variable:
CURL_CA_BUNDLE=C:\certs\cacert.pem
Some tools also respect:
SSL_CERT_FILE=C:\certs\cacert.pem
This helps with scripts, CI jobs, and local dev tools.
What if the server certificate is actually broken?
Sometimes your machine is not the problem. The server is.
Look for these signs:
- The certificate expired.
- The hostname does not match.
- The server sends no intermediate certificate.
- The certificate is self signed.
- The chain uses an old or distrusted root.
Use an SSL checker or run:
curl -v https://example.com
The -v flag shows the handshake details. It is noisy. But useful.
If the server chain is broken, fix the server certificate setup. Do not patch every client forever. That gets messy fast.
Corporate proxies and local dev certificates
Company networks can be special. By “special,” I mean “why is this broken again?”
A corporate proxy may inspect HTTPS traffic. It does this by issuing its own certificate. Your browser may trust the company root certificate. Curl may not.
Ask your IT team for the company root CA certificate. Add it to the CA bundle that curl uses. Do not grab random certificate files from chat threads. That is how weird security bugs are born.
For local development, self signed certificates are common. You have two good options:
- Add your local root CA to the trusted bundle.
- Use a dev certificate tool that installs a local trusted CA.
Avoid disabling verification across the whole app. Future you will forget. Production will remember.
Quick checklist
- Do not start with
-kas the final fix. - Update your CA bundle.
- Set the right path in PHP, curl, Git, or your app.
- Restart the service after changing config.
- Check for multiple PHP or curl installs.
- Test with
curl -v. - Fix the server chain if the server is wrong.
The simple rule
Curl Error 60 is not asking you to trust less. It is asking you to configure trust correctly.
Certificate validation is the safety guard. Keep it on. CA bundle configuration is the map curl uses to decide who is trusted. Keep it fresh and point curl to the right file.
Once those two pieces line up, the error usually disappears. No drama. No unsafe flags. Just curl doing its job without yelling at you.