Fix Server Certificate Verification Failed
This error means your client cannot validate the HTTPS server’s certificate; the fix is to repair the client’s trusted certificates or correct the server’s certificate chain, not disable verification. The right repair depends on where Git or curl runs, which trust store it uses, and whether a corporate proxy changes the certificate it receives. Use the symptoms below to narrow the cause before changing anything.
| Symptom | Likely Cause | Best Next Action |
|---|---|---|
| Many HTTPS destinations fail on a new Linux installation or minimal container | Missing or outdated CA certificates | Install or refresh the environment’s CA certificate package |
| Git fails, but curl works in the same environment | Git-specific certificate settings or a different TLS backend | Inspect Git configuration and certificate-related environment variables |
| Windows applications work, but Git inside WSL2 fails | Windows and the Linux distribution use different trust stores | Repair trust inside the affected WSL distribution |
| Requests fail only on a company network, VPN, or inspection proxy | The client does not trust the organization’s certificate authority | Obtain and install the approved organizational CA certificate |
| One destination fails across maintained clients | Expired certificate, hostname mismatch, or incomplete server chain | Have the server operator correct the certificate deployment |
| Failures begin after a clock change or VM resume | Incorrect client time | Correct the clock and retry |
What the Certificate Verification Error Means
HTTPS certificate verification checks whether the server’s certificate belongs to the requested hostname, is within its validity period, and chains to a certificate authority the client trusts.
The final fields in this error are diagnostic details:
CAfile: nonemeans the TLS backend did not report a CA bundle file for that connection. It does not prove that the computer has no trusted certificates: the client might use a certificate directory or a native operating-system store.CRLfile: nonemeans no certificate revocation list file was configured for that connection. It is not, by itself, a revocation-checking failure or an instruction to download a CRL.
A populated CAfile path does not guarantee success either. A bundle can exist but lack the required issuer, be outdated, or be overridden by another application setting.
Certificate verification is an important security check. curl verifies server certificates by default; bypassing it allows an encrypted connection without reliably establishing who is on the other end.
How to Fix Server Certificate Verification Failed
Work through these steps in the environment where the original command fails. The package-management and system-wide certificate installation commands below apply to Debian and Ubuntu, including those distributions running inside WSL or containers.
Step 1: Match the Error and Check the Client Environment
- Identify the process making the HTTPS request. DataOps.live’s troubleshooting guidance describes certificate verification failures in Git or Visual Studio Code during HTTPS Git access to the DataOps.live platform. Check where Git runs, which Linux distribution it uses, and whether the client clock is correct:
- Identify the process making the HTTPS request.
server certificate verification failed. CAfile: none CRLfile: noneIn VS Code, determine whether Git runs locally, inside WSL, over a remote connection, or in a development container. The editor’s location does not necessarily identify the Git process’s location.
- Identify the Linux distribution in that environment.
cat /etc/os-releaseDo this inside the failing WSL distribution, container, or CI worker, not only on its host.
- Check the clock before modifying certificates.
date -uCompare the output with the actual UTC date and time. If it is wrong, restore the operating system’s time synchronization; a VM or WSL environment may also need its host clock corrected. Retry the original operation after correcting the time.
Step 2: Inspect the Trust Source and Configuration Overrides
- Test the destination from the failing environment. Replace
git.example.comwith the hostname from the failed URL:curl --verbose --head https://git.example.com/Read the certificate-related output, including the issuer, validation error, and any CA file or directory paths. An HTTP rejection of the HEAD request is separate from a TLS verification failure. On Debian and Ubuntu, a common CA bundle path is
/etc/ssl/certs/ca-certificates.crt. Confirm the actual path in the failing curl output rather than assuming every installation uses it. curl is a useful comparison, but its result does not prove Git uses the same TLS backend or trust configuration. - Inspect Git’s SSL-related settings from inside the affected repository.
git config --show-origin --get-regexp '^http\..*ssl'Look for a custom
sslCAInfofile, ansslCAPathdirectory, or a verification override. The output identifies the configuration file supplying each entry. No matching output is normal when no such settings are configured. - Check environment variables that can redirect or bypass trust.
printenv GIT_SSL_CAINFO GIT_SSL_CAPATH SSL_CERT_FILE SSL_CERT_DIR CURL_CA_BUNDLE GIT_SSL_NO_VERIFYAn old virtual-environment bundle, a deleted certificate file, or a host-only path mounted incorrectly into a container can explain the failure.
- Correct only the configuration you have identified as wrong. Remove a stale override from the file or environment that defines it, or update it to an approved, readable trust source. Do not replace intentional organization-managed settings without checking their purpose. Remove verification-disabling overrides as well; a successful request with verification bypassed is not a repaired connection. Restart the affected application or job if its environment changed, then retry the original operation.
Before sharing diagnostic output, redact credentials, tokens, proxy authentication details, and private repository URLs.
Step 3: Refresh the Standard CA Certificates
Use this repair when the system’s CA package is missing, damaged, or outdated. It is especially relevant to minimal Linux images.
- Refresh package metadata.
sudo apt-get update - Install or reinstall the CA certificate package.
sudo apt-get install --reinstall ca-certificates - Regenerate the system certificate bundle and certificate-directory links.
sudo update-ca-certificates - Retry the original Git, curl, or package-manager operation. Restart a long-running process if it retains certificate configuration in memory.
Certificate verification failures can also prevent APT from downloading the CA certificate package. Use an authenticated distribution package obtained through a working, trusted system or your organization’s approved package-delivery process, then regenerate the certificate store.
Having ca-certificates installed is not conclusive: it does not add a private company CA automatically, repair an expired server certificate, or override a Git setting pointing elsewhere.
Step 4: Add an Approved Private or Corporate CA When Required
Use this branch only when the destination legitimately uses a private CA, or an authorized inspection proxy presents certificates signed by your organization.
- Obtain the approved CA certificate from a trusted administrator for the private CA or inspection service your organization uses. Do not assume a certificate with the vendor’s name is the correct one. Do not download a certificate from an unverified connection and immediately make it trusted. Avoid installing the website’s leaf certificate as a general-purpose root.
- Inspect the supplied certificate. This example assumes a PEM-encoded certificate saved as
organization-root.crt:openssl x509 -in organization-root.crt -noout -subject -issuer -dates -fingerprint -sha256Confirm its identity and fingerprint through a trusted channel with the administrator who supplied it. On Debian and Ubuntu, locally added certificate files should use the
.crtextension and contain one certificate per file. - Install it in the local CA directory.
sudo cp organization-root.crt /usr/local/share/ca-certificates/ - Update the generated trust store.
sudo update-ca-certificates - Restart the affected application and retry the HTTPS operation with verification enabled. If Git still uses an explicitly configured private bundle, adding a certificate to the system store will not necessarily affect it; correct that bundle or its override according to your organization’s configuration.
Adding a root CA changes what the environment trusts. Keep the certificate’s origin documented so it can be replaced or removed when the organization changes its inspection or PKI configuration.
Special Cases for WSL2, Containers, and Corporate Networks
Repair trust in the environment that runs the failing process, not just on the computer hosting it.
WSL2 and Remote VS Code Sessions
A certificate trusted by Windows is not automatically available to Linux applications inside WSL2. Likewise, a VS Code window connected to WSL can invoke Linux Git rather than Windows Git.
Open a terminal inside the affected distribution and inspect its Git settings and CA package. If your company requires an inspection CA, install the approved certificate in that distribution’s trust store, then restart the remote VS Code session and retry the repository operation.
Do not point Linux Git at an arbitrary Windows certificate-store location. Windows’ native trust store is not simply a PEM bundle that Linux tools can consume.
Docker Containers and CI Workers
Updating the host does not necessarily update an image’s CA package or a running container’s filesystem. An interactive repair inside a disposable container also disappears when the container is replaced.
Make the repair part of the maintained image or job setup: install the distribution’s CA package, add an approved private CA if required, and regenerate the trust store in that environment. Rebuild the image, replace the container or worker, and test the HTTPS operation in the replacement.
For Jenkins, identify whether the failure comes from command-line Git on an agent or from a Java component. Those processes can use different trust stores; changing Java’s trust configuration does not automatically repair command-line Git.
Netskope, VPNs, and HTTPS Inspection
An inspection proxy can present a certificate issued by an organizational CA instead of the destination’s public CA. An issuer that changes between approved network paths is a useful clue, but not a reason to trust an unfamiliar certificate automatically.
Confirm the expected issuer with your administrator and install the approved CA in the exact runtime performing the request. Reconnect through the required company network and test again. Do not bypass the inspection policy.
Handle Invalid Server Certificates and Older Chains
Incomplete, Expired, or Mismatched Certificates
If the client is maintained and its trust configuration is correct, inspect the certificate chain the server actually presents.
For a direct HTTPS connection, OpenSSL can show the supplied certificates and enforce verification. Replace the example hostname in all positions:
openssl s_client -connect git.example.com:https -servername git.example.com -showcerts -verify_return_error -verify_hostname git.example.com </dev/null
The https service name selects the standard HTTPS port. This command tests a direct connection; it does not automatically reproduce curl’s or Git’s explicit HTTP proxy configuration. OpenSSL can also use a different trust source, so treat its output as diagnostic evidence rather than a definitive test of Git.
Match the failure to the repair:
- Missing intermediate certificate: Configure the server or load balancer to send its leaf certificate and the required intermediate certificates.
- Expired or not-yet-valid certificate: Confirm the client clock, then renew or replace the affected server certificate or chain.
- Hostname mismatch: Use the intended hostname or deploy a certificate covering the hostname clients actually request.
- Unexpected issuer: Investigate proxy interception, DNS routing, and endpoint configuration before adding trust.
The server operator should activate the corrected certificate configuration, reload the relevant service, and retest from an affected client. If you do not control the server, provide its hostname, the failure time, the presented issuer, and the verification error to its administrator.
Historical Cross-Signed Root Workarounds
For the historical DataOps.live HTTPS Git issue, the relevant root is Let’s Encrypt’s ISRG Root X1, according to DataOps.live’s platform guidance. The chain forms involved are a self-signed certificate and a certificate cross-signed by DST Root CA X3; the shared root name does not make the certificates interchangeable.
In that DataOps.live compatibility case, Ubuntu 22.04.1 LTS is identified as trusting the self-signed form rather than the cross-signed form. Confirm the affected client’s operating-system version, its installed trust store, and the chain it receives. The version alone is not enough to establish the cause.
The following DataOps.live commands are historical instructions, not a recommended current repair.
The historical workaround downloaded the cross-signed certificate:
wget https://letsencrypt.org/certs/isrg-root-x1-cross-signed.pem
It then copied the downloaded certificate into the certificate directory:
sudo cp isrg-root-x1-cross-signed.pem /etc/ssl/certs/
Do not use those commands to restore trust in an expired chain. Copying a PEM file into that directory also does not reliably update every application’s CA bundle or the hashed directory entries it may require.
For a current repair, use the maintained distribution CA package containing the supported self-signed root, and have the server operator correct an obsolete presented chain.
Confirm the Fix and Keep It Working
Test from the same shell, repository, network path, and runtime that originally failed.
For a Git repository whose remote is named origin, this checks access without modifying the working tree:
git ls-remote origin
A successful result normally lists remote references. An empty repository can return no references while still completing successfully.
For curl, repeat the request against the affected hostname:
curl --verbose --head https://git.example.com/
Check that:
- Certificate verification completes without a certificate error.
- Git reaches the repository, or curl receives an HTTP response.
- A restarted application or freshly rebuilt container still succeeds.
An authentication error after TLS succeeds is a separate problem; investigate credentials or permissions rather than continuing to replace certificates.
Keep operating systems, CA packages, and base images maintained. Store required corporate CA provisioning in your documented image or workstation setup, rather than relying on an undocumented interactive change.
Once verification succeeds, retry the original clone, pull, download, or package update to confirm that the actual workflow is restored.
Frequently Asked Questions
Why Does the Same URL Work in My Browser?
A browser can use a different trust store, proxy path, or intermediate-certificate cache from Git or curl. It may also be running on a different computer from the failing process. A successful browser visit does not prove that the failing client has the required trust chain.
Is an APT Certificate Failure the Same as a Repository Signing-Key Error?
No. HTTPS certificate verification authenticates the connection to the repository, while repository-signature verification authenticates the downloaded package metadata. Adding a repository signing key does not repair an HTTPS certificate failure; restore the TLS connection, refresh package metadata, and address any remaining signature error separately.
Why Did a Certificate Error Lead to gzip or tar Errors?
The download may have failed before producing a complete archive, leaving the extraction command with empty or truncated input. Fix certificate verification and download the artifact successfully before extracting it again. Avoid streaming an unverified or failed download directly into an installer or extraction pipeline.
