The problem
When working in an environment that is either a private enterprise, one with its own internal PKI, or even your home lab you may run into this issue when working with git. Since there is not an external CA to validate your git address for HTTPS you will run into this error.
- [fatal: unable to access 'PATH_TO_REPO': SSL certificate problem: self signed certificate in certificate chain]
All this means is that when trying to access the repository to clone it your git client was unable to validate the certificate. Sometimes on Windows or even Linux, your git client will use its own CA repository to validate against and it makes it difficult to configure.
Workaround
There are a few ways to get around this.
Method 1 - Single-use git clone with SSL turned off
git -c http.sslVerify=false clone <repository-name>
Method 2 - Globally turn off SSL for git
git config --global http.sslVerify false
Only disable git globally in a test environment. This is considered a large security risk.
Solution
Like it was stated above on some git applications there will need to be configurations made specifically for that use. This is the general way to remedy this issue correctly.
This only works for servers that have certificates from a CA. This will not work for self-signed.
- Import your CA file into your local trusted ca store.
- Input the following command.
git config --system http.sslCAPath /path/to/cacerts