Solution 1 (worst): disable certificate in GTI configuration
git config --global http.sslCAinfo /bin/curl-ca-bundle.crt
Solution 2: if this problem is occuring because git cannot complete the https handshake with the git server were the repository you are trying to access is present.
Steps to get the certificate from the github server
- Open the github you are trying to access in the browser
- Press on the lock icon in the address bar > click on ‘certicicate’
- Go to ‘Certification Path’ tab > select the top most node in the heirarchy of certifcates > click on ‘view certificate’
- Now click on ‘Details’ and click on ‘Copy to File..’ > Click ‘Next’ > Select ‘Base 64 encoded X509 (.CER)’ > save it to any of your desired path.
Steps to add the certificate to local git certificate store
- Now open the certicate you saved in the notepad and copy the content along with –Begin Certificate– and –end certificate–
- To find the path were all the certificates are stored for your git, execute the following command in cmd.git config –list
- Check for the key ‘http.sslcainfo’, the correspondig value will be path.
- Now open ‘ca-bundle.crt’ present in that path.
Note 1 : open this file administrator mode otherwise you will not be able to save it after update. (Tip – you can use Notepad++ for this purpose)
Note 2 : Before modifying this file please keep a backup elsewhere.
- Now copy the contents of file mentioned in step 1 to the file in step 4 at end file, like how other certificates are placed in ca-bundle.crt.
- Now open a new terminal and now you should be able to perform opertions related to the git server using https.
To know where gitconfig file is:
git config --list --show-origin