T The Triage ManualTechnical Guides for IT Emergencies
P3 · PKI & Certificate Management

Git on Windows fails with 'unable to get local issuer certificate' using HTTPS and self-signed certificate

Git for Windows uses cURL with its own certificate bundle (curl-ca-bundle.crt) rather than the Windows system certificate store, causing HTTPS SSL verification failures even when a self-signed certificate is trusted by Windows. The root cause is typically that IIS Manager's built-in 'Create Self Signed Certificate' produces a leaf certificate with no valid issuer chain that cURL cannot validate. The fix requires creating a proper two-tier CA root certificate, using it to issue a server authentication certificate, and appending the PEM-encoded CA root to a private copy of curl-ca-bundle.crt referenced by Git config.

Indicators

Likely causes

Diagnostic steps

  1. Confirm Git is using HTTPS: run 'git remote -v' in the repository directory and verify the remote URL begins with 'https://'
  2. Check which certificate bundle Git is using: run 'git config --global http.sslCAInfo' and note the full file path returned
  3. Temporarily rename the curl-ca-bundle.crt file identified above and retry a Git operation — confirm Git reports the bundle as missing, proving it is the active trust source
  4. Clone a known public HTTPS repository (e.g., github.com) to confirm base Git/cURL SSL functionality is working correctly before investigating the internal certificate
  5. Inspect the server certificate: open IIS Manager, navigate to Server Certificates, and check whether the certificate was created using 'Create Self Signed Certificate' — these certificates have no issuer chain and are incompatible with cURL validation
  6. Export the server certificate in PEM format and open it in a text editor — verify it begins with '-----BEGIN CERTIFICATE-----' and ends with '-----END CERTIFICATE-----' before appending to curl-ca-bundle.crt

Resolution path

Prevention

Tools

References

gitsslwindowsself-signed-certificatecurlhttpsiiscertificate-authoritycurl-ca-bundlemsysgitmakecertpkideveloper-toolingcertificate-trust