SSL certificate issue while creating git clone with TortoiseGit

后端 未结 7 1364
心在旅途
心在旅途 2021-01-31 04:33

I want to clone the git repository with the help of TortoiseGit, but I am getting error :

error: SSL certificate problem, verify that the CA cert is OK. Details: error:1

相关标签:
7条回答
  • 2021-01-31 04:54

    All the top answers are really dangerous! Do not disable SSL verification globally!

    Instead, use the excellent answer in another thread and very selectively allow a self-signed certificate for a specific site.

    Edit the global .gitconfig file to include

    [http "https://example.com"]
        sslCAInfo = C:\\Users\\<username>\\Documents\\ssl\\example.com.crt
    

    The CRT file itself can be obtained in multiple ways. You can just save it using Firefox, store it somewhere safe and point your config to it.

    0 讨论(0)
  • 2021-01-31 04:57

    Open Git CMD and run below command.

    git config --global http.sslVerify false
    
    0 讨论(0)
  • 2021-01-31 04:59

    The correct solution is simple; Tell git to use the Windows certificate store. This is supported by git version >=2.14 (not sure what Tortoise version that relates to)

    Sadly I don't see a way to configure this in Tortoise GUI settings.

    Procedure:
    1:
    Find the folder where git (for Tortoise git is installed) TortoiseGit -> Settings -> General Git.exe path = (e.g.) C:\Program Files\git\bin

    2:
    In explorer browse this folder in Explorer Shift right click "Command Prompt here"

    3:
    Enter the following git configuration command

    git config --global http.sslBackend schannel
    

    Install your self signed certificate chains in the Windows Certificate Store as normal.

    0 讨论(0)
  • 2021-01-31 05:00

    Please check that your Git for Windows installation is correct.

    As you can see in the screenshot git.exe cannot find the template directory - so I suppose git.exe also cannot find the shipped CA certificates.

    If that doesn't help, see a description here for including a certificate into the Git trust store.

    0 讨论(0)
  • 2021-01-31 05:04

    Even though disabling ssl verifyication is considered dangerous for many reasons, sometimes this is feasible. Others have pointed out to use at least a "local" disabling, but not how to do this. For the record, here is how you can define in the global .gitconfig file (in Windows located under c:\Users\username) for a single repository to use openssl and disable the check. Just add the following (adjusted) lines:

    [http "https://your.repo.com"]
     sslBackend = openssl
     sslVerify = false
    

    For me this worked perfect. As noted and linked in the answer from FRob, here is a more nuanced option that uses the pem certificate that you can often download yourself, e.g. when "clicking" on the lock symbol in your browser before the url and searching for "additional information" (firefox, others should be similar).

    0 讨论(0)
  • 2021-01-31 05:14

    You can choose to ignore the server certificate (at your own risk!).

    Configure your TortoiseGit in the following way. First of all open the TortoiseGit settings.

    Then:

    1. Select the Git configuration
    2. Open the global git configuration pressing "Edit systemwide gitconfig"
    3. In the [http] section write:

    [http]
    sslVerify = false

    0 讨论(0)
提交回复
热议问题