Era Host hosting
EraHost – Free Domain, Cheap Hosting!
Client Area
Support 24/7
Menu

Fixing depth_zero_self_signed_cert in cPanel for Git Operations

2 min read
12.03.2026

Temporarily Disable SSL Verification (Quick Fix)

If you just need a temporary workaround, disable SSL verification for Git:

Git depth_zero_self_signed_cert cPanel
Git SSL self-signed — short-term skip, long-term trust the issuer.

For the broader SSL/TLS-error variant and related cPanel topics, see Fixing depth_zero_self_signed_cert in SSL/TLS and cpsrvd — cPanel Service Daemon.

git config --global http.sslVerify false

Warning: This is insecure and should only be used for testing.

To disable SSL verification only for a specific repository, run this inside the repo:

git config --local http.sslVerify false

Test Git again:

git clone https://yourdomain.com/repo.git
cPanel Hosting
Full control over your website
  • Convenient
  • Simple
  • Fast
  • Free 7-day trial
cPanel Hosting

Add the Self-Signed Certificate to Git (Permanent Fix)

If you want a secure solution without disabling SSL verification, manually add the self-signed certificate.

Locate Your SSL Certificate in cPanel

  1. Log into cPanel
  2. Go to SSL/TLS > Manage SSL Sites
  3. Find your domain and click View Certificate
  4. Copy the certificate (from -----BEGIN CERTIFICATE----- to -----END CERTIFICATE-----)

Save the Certificate on Your Server

  1. Connect to cPanel via SSH
    ssh youruser@yourdomain.com
  2. Create a new CA certificate file
    nano ~/my-self-signed-ca.crt
  3. Paste the copied certificate and save the file (Ctrl + X, then Y to save).

Add the Certificate to Git

git config --global http.sslCAInfo ~/my-self-signed-ca.crt

Test Git again:

git clone https://yourdomain.com/repo.git

If it works, your Git now trusts the self-signed SSL certificate!

Add the Certificate to the System's Trusted Store

For Debian/Ubuntu

sudo cp ~/my-self-signed-ca.crt /usr/local/share/ca-certificates/
sudo update-ca-certificates

For CentOS/RHEL

sudo cp ~/my-self-signed-ca.crt /etc/pki/ca-trust/source/anchors/
sudo update-ca-trust

Restart Git and test again.

Summary of Fixes

Issue Fix
Temporary Git fix git config --global http.sslVerify false (!Insecure)
Permanent Git fix git config --global http.sslCAInfo ~/my-self-signed-ca.crt
Trust system-wide Add certificate to /usr/local/share/ca-certificates/ and run update-ca-certificates

Now Git should work correctly on cPanel with your self-signed SSL certificate!

Frequently asked questions
Safe in the sense that you bypass the check; *not* safe in the sense that you accept any cert MITM might present. For one-off cloning from a known internal server where you can vouch for the network, fine. For pushing to a repo over public internet, dangerous — anyone intercepting the connection can read or alter the code you push.
Debian/Ubuntu: copy cert PEM to `/usr/local/share/ca-certificates/yourcert.crt`, run `sudo update-ca-certificates`. RHEL/CentOS: copy to `/etc/pki/ca-trust/source/anchors/`, run `sudo update-ca-trust extract`. After either, openssl, curl, and git all trust it. Add the issuer CA, not the leaf cert, so future cert renewals don't break.
`git config --global http."https://gitlab.internal.com/".sslCAInfo /path/to/ca.pem` — trusts the specific CA file for that remote only. More targeted than global sslVerify off. Or import to system trust per the previous answer. Per-remote config is cleaner if you only need this trust for one server.
cPanel's git tool may run as a different user (often the cpaneluser) with a different HOME and gitconfig. Settings made via `git config --global` as your shell user don't apply. Either set system-wide in /etc/gitconfig, or use the cPanel Git interface's URL field with credentials embedded. Better: import the CA system-wide so any user benefits.
Related articles
Fixing depth_zero_self_signed_cert in cPanel with a Self-Signed Certificate
Fixing depth_zero_self_signed_cert Error in SSL/TLS
Error: "Domain has exceeded the max defers and failures per hour (5/5 (100%)) allowed. Message discarded."