Skip to content
FR
  1. LuzineDebug
  2. Systems (Windows, macOS, Linux)
  3. SSL certificate problem: unable to get local iss…
Systems (Windows, macOS, Linux) Intermediate ≈ 20 min to fix

Fix "SSL certificate problem: unable to get local issuer certificate" (git, curl, pip, npm)

Error message
SSL certificate problem: unable to get local issuer certificate
  • fatal: unable to access 'https://github.com/user/repo.git/': SSL certificate problem: unable to get local issuer certificate
  • curl: (60) SSL certificate problem: unable to get local issuer certificate
  • ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate
  • npm error code UNABLE_TO_GET_ISSUER_CERT_LOCALLY
  • SSL certificate problem: self-signed certificate in certificate chain
In short

The tool cannot find, in its certificate store, the authority that signed the server's certificate. In a company, it is almost always a proxy or antivirus inspecting HTTPS with its own root certificate. Add that root certificate to the system or tool store; do not disable SSL verification.

Be the first to confirm this fix

What this error means

To trust an HTTPS server, the client walks the certificate chain up to a root authority present in its local store. "unable to get local issuer certificate" means that walk fails: the issuer of the last certificate received is not in the store. Not every tool uses the system store: Python often relies on certifi, Node.js on its own Mozilla list, Git for Windows on an OpenSSL bundle. That is why the browser works while git, pip or npm fail.

Common causes

  1. Proxy or antivirus inspecting HTTPS (Zscaler, Netskope, Fortinet, antivirus HTTPS scanning): it re-signs certificates with an internal root the tool does not know.
  2. Tool with its own store: Python (certifi), Node.js, Git for Windows or curl built with OpenSSL ignore certificates added to the system by IT.
  3. Outdated store: old certifi, old system, or Python installed from python.org on macOS without running Install Certificates.command.
  4. Incomplete chain on the server: the server does not send the intermediate certificate. Browsers fetch it on their own, command-line tools do not.
  5. Self-signed certificate on an internal server (GitLab, Nexus, private registry): you must trust that certificate or the internal authority that issued it.

Step-by-step fix

  1. Find who signs the certificate

    Look at the issuer of the chain you receive. If it names your company, proxy or antivirus, it is TLS inspection. If the chain stops at a public intermediate certificate, the server is misconfigured: it must serve the full chain.

    bash
    openssl s_client -connect github.com:443 -servername github.com -showcerts </dev/null | grep -E 'subject=|issuer='
    curl -v https://pypi.org/simple/ -o /dev/null
  2. Install the root certificate in the system

    Get the root certificate from your IT team, or export it from the browser (top certificate of the chain, Base-64 PEM format). Then add it to the system store. On Windows, your company has often already deployed it.

    bash
    # macOS
    sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain corp-root.pem
    # Debian / Ubuntu (file must end in .crt)
    sudo cp corp-root.crt /usr/local/share/ca-certificates/
    sudo update-ca-certificates
    # Fedora / RHEL
    sudo cp corp-root.pem /etc/pki/ca-trust/source/anchors/
    sudo update-ca-trust
  3. Configure git

    On Windows, the simplest option is to make Git use the Windows store (Schannel). Elsewhere, after the previous step, git usually already uses the system store. Otherwise, point it to a bundle: note that http.sslCAInfo replaces the default bundle, so it must contain the public roots and the company root.

    bash
    # Windows
    git config --global http.sslBackend schannel
    # macOS / Linux, if still needed
    git config --global http.sslCAInfo /path/to/ca-bundle.pem
  4. Configure Python and pip

    Recent pip versions use the system store through truststore: start by upgrading pip. For requests, point to a bundle with an environment variable. On macOS with Python from python.org, run Install Certificates.command in the Python folder inside Applications.

    bash
    python -m pip install --upgrade pip certifi
    pip config set global.cert /path/to/ca-bundle.pem
    export REQUESTS_CA_BUNDLE=/path/to/ca-bundle.pem
    export SSL_CERT_FILE=/path/to/ca-bundle.pem
  5. Make a Python script use the system store

    The truststore package makes ssl, requests and urllib3 use the system certificate store, the one where your company already installed its root.

    python
    # pip install truststore requests
    import truststore
    truststore.inject_into_ssl()
    
    import requests
    print(requests.get("https://pypi.org/simple/").status_code)
  6. Configure Node.js and npm

    NODE_EXTRA_CA_CERTS adds your root certificate to Node.js's own, without removing the others; it is read when the process starts. npm config set cafile replaces npm's list, so the file must be a full bundle. Recent Node.js versions also accept --use-system-ca.

    bash
    export NODE_EXTRA_CA_CERTS=/path/to/corp-root.pem
    npm config set cafile /path/to/ca-bundle.pem
    # Recent Node.js versions
    export NODE_OPTIONS=--use-system-ca
  7. Do not disable SSL verification

    git config --global http.sslVerify false, curl -k, npm config set strict-ssl false, NODE_TLS_REJECT_UNAUTHORIZED=0 or verify=False make the tool accept any certificate. An attacker on the network can then intercept your credentials and tokens and tamper with the code or packages you download. These global settings stay active and forgotten. If you must test, limit it to a single command, then check with git config --global --list that nothing is left behind.

Did this fix work for you?

Confirm it in one click: it will rise for the next developers stuck on the same error.

Keep it from coming back

  • Install the company root once in the system store and configure your tools to use it (Schannel, truststore, --use-system-ca).
  • Keep certifi, pip, Node.js and Git up to date so you have recent authority lists.
  • Never commit sslVerify false, strict-ssl false or NODE_TLS_REJECT_UNAUTHORIZED=0 in a project, Dockerfile or CI config.

Frequently asked questions

Is git config http.sslVerify false dangerous?

Yes. Git then accepts any certificate and can no longer detect interception: credentials and code can be read or altered. Install the missing root certificate instead.

Why does the site work in the browser but not with git or pip?

The browser uses the system store, where your company installed its root, and fetches missing intermediate certificates on its own. git, pip or npm often use their own list and do not complete the chain.

How is it different from "self-signed certificate in certificate chain"?

In that case the tool did receive the root, but it is self-signed and missing from its store, which also happens with a corporate proxy. The fix is the same: trust that root.

Useful tools for this error

More Systems (Windows, macOS, Linux) errors

All Systems (Windows, macOS, Linux) errors →