How to Fix ‘SSL Certificate Problem’ (cURL Error 60) in Ubuntu

Executing API requests, downloading repository keys, or fetching files via command-line utilities in Ubuntu often triggers an SSL verification halt: curl: (60) SSL certificate problem: unable to get local issuer certificate. More details here: https://curl.se/docs/sslcerts.html. This error prevents automated deployment scripts, Composer, npm, Python pip, and PHP applications from establishing secure HTTPS connections. Rather than bypassing validation with insecure flags, this issue must be solved by addressing local CA bundle configurations.

Resolving cURL error 60 requires updating the local certificate authority bundle, synchronising system clocks, installing missing enterprise intermediate certificates, and pointing PHP/cURL configurations to the valid certificate store.

Why Does cURL Report Error 60 in Ubuntu?

cURL performs strict TLS verification by validating the remote web server’s SSL certificate chain against trusted root certificates stored in the local Linux system bundle (/etc/ssl/certs/ca-certificates.crt). Error 60 occurs when:

  • Outdated Local CA Certificates: The remote server utilizes a newly issued root certificate that does not exist in an un-updated local ca-certificates package.
  • System Time Drift: If the local Ubuntu system clock is significantly ahead of or behind real UTC time, certificates appear not yet valid or already expired.
  • Missing Intermediate Certificates: The target web server is misconfigured and fails to supply required intermediate certificates along with its leaf certificate.
  • Corporate Proxy / SSL Inspection: Corporate firewalls (such as Zscaler, Fortinet, or Palo Alto) intercept TLS traffic using an internal self-signed certificate authority unknown to the Ubuntu trust store.
  • Misconfigured cURL CA Path in PHP: In web development environments, php.ini points curl.cainfo or openssl.cafile to non-existent certificate paths.

Step 1: Verify and Synchronise System Time

TLS certificate validity windows are strictly verified against the current system time:

  1. Open a terminal and check your system’s current time and NTP synchronisation status:
    timedatectl
  2. Ensure that NTP service: active (or System clock synchronized: yes) is displayed.
  3. If the clock is out of synchronisation, restart the systemd time synchronisation service:
    sudo systemctl restart systemd-timesyncd
  4. Confirm that the reported local time and UTC timestamp match current real-world coordinates.

Step 2: Update the Local ca-certificates Package

Ubuntu maintains trusted root certificates in the ca-certificates package. Updating this database resolves expired root references (such as legacy DST Root CA X3 issues):

  1. Update your local package lists:
    sudo apt update
  2. Reinstall and upgrade the certificate bundle package:
    sudo apt install --reinstall ca-certificates
  3. Rebuild the certificate authorities directory and generate an updated /etc/ssl/certs/ca-certificates.crt bundle:
    sudo update-ca-certificates --fresh
  4. Test your cURL request again:
    curl -I https://digitash.com

Step 3: Install Custom or Corporate Root Certificates

If your organisation routes network traffic through an SSL-inspecting proxy, you must add the enterprise CA certificate to Ubuntu’s trusted store:

  1. Obtain the root certificate in .crt or PEM format from your network administrator.
  2. Copy the certificate file into the extra certificates directory:
    sudo cp company_root_ca.crt /usr/local/share/ca-certificates/
  3. Ensure correct file permissions:
    sudo chmod 644 /usr/local/share/ca-certificates/company_root_ca.crt
  4. Update the system trust store:
    sudo update-ca-certificates
    Verify that the terminal output confirms: 1 added, 0 removed; done.
  5. Verify that cURL now connects securely through the proxy without error 60.

Step 4: Configure curl.cainfo in PHP Environments

If cURL error 60 occurs specifically when executing PHP applications (e.g. Laravel, WordPress CLI, or Symfony):

  1. Locate your active php.ini configuration file:
    php --ini
  2. Open your php.ini file with an editor (adjust path according to your PHP version):
    sudo nano /etc/php/8.3/cli/php.ini
  3. Search for curl.cainfo and openssl.cafile.
  4. Uncomment the lines (remove leading semicolons) and set them to the authentic Ubuntu bundle path:
    curl.cainfo = /etc/ssl/certs/ca-certificates.crt
    openssl.cafile = /etc/ssl/certs/ca-certificates.crt
  5. Save changes with Ctrl + O, exit with Ctrl + X, and restart your web server or PHP-FPM service:
    sudo systemctl restart php8.3-fpm

Step 5: Diagnosing Misconfigured Server Certificate Chains

If cURL fails on a specific external domain while working for standard websites, inspect the server’s TLS handshake:

  1. Run OpenSSL s_client to view the full chain delivered by the remote host:
    openssl s_client -connect example.com:443 -servername example.com
  2. Check the Certificate chain section. If the remote server fails to send intermediate CA certificates, the local validator cannot link the leaf certificate to a known root.
  3. Notify the site administrator to bundle intermediate certificates into their web server SSL configuration (fullchain.pem).

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.