Curl: (60) ssl certificate problem: unable to get local issuer certificate linux

This document (000020585) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Manager Server 4.1
SUSE Manager Server 4.2
SUSE Linux Enterprise Server 12
SUSE Linux Enterprise Server 15

Situation

Any zypper command which needs to download data from the SUSE Manager Server gives the following error:

Error code: Curl error 60
Error message: SSL certificate problem: unable to get local issuer certificate

Resolution

Depending on which SUSE Manager client is used, the following steps are needed to solve the issue.

1. On servers running the salt-minion.service run "salt-call state.apply certs"

2. On servers using the traditional client.

2.1   Is rhn-org-trusted-ssl-cert-1.0-1.noarch.rpm package installed?
2.1.1 Check with "rpm -qa | grep rhn-org-trusted-ssl-cert-1.0-1.noarch" if installed go to step 2.2, if not installed continue with step 2.1.2.
2.1.2 Get the package from the server with "wget http://<sumaserver-fqdn>/pub/rhn-org-trusted-ssl-cert-1.0-1.noarch.rpm"
2.1.3 Install the package with "rpm -ihv rhn-org-trusted-ssl-cert-1.0-1.noarch.rpm"

Or

2.2   Is the softlink "/etc/pki/trust/anchors/RHN-ORG-TRUSTED-SSL-CERT" available? If not create it with:
2.2.1 "ln -s /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT /etc/pki/trust/anchors/RHN-ORG-TRUSTED-SSL-CERT"
2.2.2 Followed by a "update-ca-certificates"

Cause

The file RHN-ORG-TRUSTED-SSL-CERT or the link to the file RHN-ORG-TRUSTED-SSL-CERT is missing in the /etc/pki/trusts/anchors directory.
For the SUSE Manager clients to be able to contact the SUSE Manager Server the Trusted SSL Certificate is needed.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000020585
  • Creation Date: 11-Mar-2022
  • Modified Date:11-Mar-2022
    • SUSE Linux Enterprise Server
    • SUSE Manager Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact:

Edit: I had updated my root CA certificates from curl.haxx.se .


When I try curl -Iv https://yahoo.com I get an error as unable to get local issuer certificate in the result. However if I try curl -Iv --cacert /etc/ssl/certs/ca-certificates.crt https://yahoo.com I get a result without any error.

Weirdly curl -Iv https://google.com works properly. But curl -Iv https://deb.nodesource.com doesn't.

Is there any chance to overcome this issue? (by changing curl configuration etc.)

root@ip-172-31-40-176:/var# curl -Iv https://yahoo.com * Rebuilt URL to: https://yahoo.com/ * Hostname was NOT found in DNS cache * Trying 206.190.36.45... * Connected to yahoo.com (206.190.36.45) port 443 (#0) * successfully set certificate verify locations: * CAfile: none CApath: /etc/ssl/certs * SSLv3, TLS handshake, Client hello (1): * SSLv3, TLS handshake, Server hello (2): * SSLv3, TLS handshake, CERT (11): * SSLv3, TLS alert, Server hello (2): * SSL certificate problem: unable to get local issuer certificate * Closing connection 0 curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: http://curl.haxx.se/docs/sslcerts.html curl performs SSL certificate verification by default, using a "bundle" of Certificate Authority (CA) public keys (CA certs). If the default bundle file isn't adequate, you can specify an alternate file using the --cacert option. If this HTTPS server uses a certificate signed by a CA represented in the bundle, the certificate verification probably failed due to a problem with the certificate (it might be expired, or the name might not match the domain name in the URL). If you'd like to turn off curl's verification of the certificate, use the -k (or --insecure) option.

We run the following software versions:

  • Ubuntu 18.04.5
  • Apache 2.4.29
  • curl 7.58.0

We run an education application, and as part of this we have numerous APIs which upload files to a third party website https://api.turnitinuk.com from our webserver https://nclhe-moodle.ncl-coll.ac.uk.

We renewed our SSL certificate for nclhe-moodle.ncl-coll.ac.uk in December 2020 on the webserver successfully and everything carried on working as we expected it to, but then suddenly in February 2021 we started getting the following error and the upload failed.

curl: (60) SSL certificate : unable to get local issuer certificate

(I dont understand what the local issuer certificate is, is it the client (the webserver) or the server)

Not sure why, it just started in February 2021 when the certificates were renewed in December 2020.

If I bypass the IPS Certificate checking on our proxy server, our API works successfully.

These are what I have tried so far to resolve this issue:

  • Ran this command on the webserver:

    curl -vs https://api.turnitinuk.com

    Error below:

    * Rebuilt URL to: https://api.turnitinuk.com/ * Trying 199.47.86.35... * TCP_NODELAY set * Connected to api.turnitinuk.com (199.47.86.35) port 443 (#0) * ALPN, offering h2 * ALPN, offering http/1.1 * successfully set certificate verify locations: * CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs * TLSv1.3 (OUT), TLS handshake, Client hello (1): * TLSv1.3 (IN), TLS handshake, Server hello (2): * TLSv1.2 (IN), TLS handshake, Certificate (11): * TLSv1.2 (OUT), TLS alert, Server hello (2): * SSL certificate problem: unable to get local issuer certificate * stopped the pause stream! * Closing connection 0
  • Run the following OpenSSL command to get the certificate chain from the our Moodle instance

    openssl s_client -showcerts -servername nclhe-moodle.ncl-coll.ac.uk -connect nclhe-moodle.ncl-coll.ac.uk:443
  • Downloaded all 3 certificates in the certificate chain of https://nclhe-moodle.ncl-coll.ac.uk and checked to ensure they were already in the /etc/ssl/certs/ca-certificates.crt file. Sure enough, one of them, the intermediate cert, was not in the ca-certificates.crt file.

  • Converted the 1 .cer files to .crt using the following command

    openssl x509 -inform PEM -in QuoVadis_Global_SSL_ICA_G3.cer -out QuoVadis_Global_SSL_ICA_G3.crt
  • Uploaded the .crt file to /usr/local/share/ca-certificates directory.

  • Run the command

    sudo update-ca-certificates
  • Looking at the /etc/ssl/certs/ca-certificates.crt file then missing certificate is now in the file and the 2 sym-links hves been created in the /etc/ssl/certs directory as follows

    • QuoVadis_Global_SSL_ICA_G3.pem -> /usr/local/share/ca-certificates/QuoVadis_Global_SSL_ICA_G3.crt

    • 35e514f6.0 -> QuoVadis_Global_SSL_ICA_G3.pem

  • Stopped and restarted apache

    sudo /etc/init.d/apache2 stop sudo /etc/init.d/apache2 start
  • Retried again but i still have the same error

Another question from me:

In my /etc/ssl/certs file all of the CA's are sym-linked to /usr/share/ca-certificates apart from the CA which i have just applied which is sym-linked to /usr/local/share/ca-certificates. Is this an issue bearing in mind the certificate is part of the /etc/ssl/certs/ca-certificates/crt file?

I am a bit stumped about what else to try and have researched this extensively to try and fix it myself, can anybody help

Many thanks in advance,

Mac


The latest update - the issue is not yet resolved. The files are uploaded automatically via an API, so the turnitin application sits within https://nclhe-moodle.ncl-coll.ac.uk , the users login , click a few buttons and the app uploads files via the API to https://api.turnitinuk.com. The only thing that has changed is the SSL cert was renewed successfully in December 2020 but this issue never started until Feb 2021.

How do I fix curl 60 SSL certificate?

Locate the curl certificate PEM file location 'curl-config --ca' -- > /usr/local/etc/openssl/cert.pem..
Use the folder location to identify the PEM file 'cd /usr/local/etc/openssl'.
Create a backup of the cert.pem file 'cp cert.pem cert_pem.bkup'.

How do I fix unable to get local issuer certificate?

When ssl certificate problem unable to get local issuer certificate error is caused by a self-signed certificate, the fix is to add the certificate to the trusted certificate store. Open the file ca-bundle. crt located in the directory above, then copy and paste the Git SSL certificate to the end of the file.

How does curl verify SSL certificate?

libcurl performs peer SSL certificate verification by default. This is done by using a CA certificate store that the SSL library can use to make sure the peer's server certificate is valid.

How do I bypass SSL verification in curl?

To bypass SSL certificate validation for local and test servers, you can pass the -k or --insecure option to the Curl command. This option explicitly tells Curl to perform "insecure" SSL connections and file transfers. Curl will ignore any security warnings about an invalid SSL certificate and accept it as valid.