This usually happens when your Git repository server is hosted inside a private network and uses a locally generated (self signed) TLS certificate. Because this certificate is not from a "trusted" source, most software will complain that the connection is not secure.
So you need to disable SSL verification on Git to clone the repository and immediately enable it again, otherwise Git will not verify certificate signatures for any other repository.
- Disable SSL verification on Git globally:
git config --global http.sslVerify false
- Clone your repository:
git clone <your repo>
- Enable SSL verification on Git globally:
git config --global http.sslVerify true
- Change directory into your repo:
cd <your repo>
- Disable SSL verification only on your repository:
git config --local http.sslVerify false
In the first step, when turning off SSL verification, if you're getting this error:
warning: http.sslverify has multiple values
error: cannot overwrite multiple values with a single value
Use a regexp, --add or --replace-all to change http.sslVerify.
Open your .gitconfig file and remove duplicate http.sslverify
lines.