
Your script or terminal command fails with cURL error 60: SSL certificate problem: unable to get local issuer certificate. This cURL error 60 fix guide explains what is actually missing — a trusted CA certificate bundle on the machine making the request — and shows the exact fix for Windows/PHP, Linux, and macOS, plus what server owners should check. Updated for 2026.
The key insight most guides bury: this error is about your machine, not the server you are contacting. When cURL opens an HTTPS connection, it verifies the server’s certificate against a local list of trusted Certificate Authorities. If that list is missing, outdated, or not configured, cURL refuses the connection for security reasons — even when the server’s certificate is perfectly valid. The fix is giving cURL the trust list it needs.
What Causes cURL Error 60
- Missing CA bundle (Windows/XAMPP/WAMP): PHP on Windows ships without a default CA bundle path configured — the most common cause.
- Outdated CA certificates (Linux): the
ca-certificatespackage is missing or stale on fresh servers. - Custom PHP builds: compiled PHP pointing at a CA path that does not exist.
- Private/internal CA: the server uses a company CA whose root was never added to the local trust store.
- Incomplete server chain: the server omits intermediate certificates, so no trust path can be built.
How to Fix cURL Error 60: 7 Steps
Step 1: Fix PHP on Windows (XAMPP / WAMP / standalone)
Download the official CA bundle from https://curl.se/ca/cacert.pem and save it somewhere stable, e.g. C:\xampp\php\extras\ssl\cacert.pem. Open php.ini, find ;curl.cainfo =, uncomment it and set curl.cainfo = "C:\xampp\php\extras\ssl\cacert.pem". Do the same for openssl.cafile. Restart Apache/PHP. On shared hosting without php.ini access, add curl.cainfo="/path/to/cacert.pem" to a .user.ini file in public_html.
Step 2: Fix Linux servers
On Ubuntu/Debian, run sudo apt-get update && sudo apt-get install ca-certificates && sudo update-ca-certificates. On RHEL/CentOS/Fedora use the equivalent yum/dnf CA package. Then verify with curl -v https://example.com and confirm the handshake completes.
Step 3: Point cURL at a bundle directly
For one-off commands, pass the bundle explicitly: curl --cacert /path/to/cacert.pem https://example.com. To make it permanent for your shell sessions, set the environment variable CURL_CA_BUNDLE=/path/to/cacert.pem or add cacert = /path/to/cacert.pem to your .curlrc file.

Step 4: Handle private and internal CAs
If the server uses your organisation’s private CA, download that CA’s root certificate and append it to your bundle (or place it in the system trust store: /usr/local/share/ca-certificates/ on Debian/Ubuntu followed by update-ca-certificates; Keychain on macOS). cURL will then trust the internal chain.
Step 5: Check the server’s certificate chain
Run curl -v https://example.com and read the certificate section, or use openssl s_client -connect example.com:443 -showcerts. If intermediates are missing, the server must be fixed to send the full chain (leaf + intermediates) — no client-side bundle can compensate for a broken chain. For server-side chain fixes, see our certificate chain guide.
Step 6: The -k flag — testing only, never production
curl -k (or --insecure) skips certificate verification entirely and will “fix” the error instantly. Use it only to confirm the rest of your request works during development. Never use it in production code or with sensitive data — it disables the very protection TLS exists to provide. In PHP, the equivalent CURLOPT_SSL_VERIFYPEER => false is equally dangerous outside testing.
Step 7: Verify the permanent fix
Re-run your original command without workarounds and confirm a clean handshake. In PHP, verify with php -r "var_dump(openssl_get_cert_locations());" that curl.cainfo resolves to a real file. Schedule periodic ca-certificates updates so the trust store never goes stale. For related TLS issues, see our cURL error 35 fix.
How to Prevent cURL Error 60
Bake CA bundle setup into your provisioning: server images should install ca-certificates by default, and Windows PHP deployments should ship a cacert.pem with php.ini pre-configured. Pin the bundle download to the official curl.se source and refresh it periodically — CAs do change. In CI/CD pipelines, add a smoke test that performs one HTTPS request so a broken trust store fails the build instead of production. A quick TLS check with a free SSL diagnostic tool confirms your endpoints present verifiable chains.
Conclusion
cURL error 60 means your machine lacks the trusted CA list needed to verify the server — download the official cacert.pem, point PHP or cURL at it, and the error disappears. Reserve -k for debugging only, and fix incomplete server chains at the source. For more developer-facing errors explained plainly, follow the KamiWeb blog.
