Jenkins Git fatal: unable to access 'https//URL.git': SSL certificate p‌r‌o‌b‌l‌e‌m: self signed certificate

11,295

Solution 1

I don't know if you have found the answer already by yourself. In case, please have a look at the answer at Jenkins git plugin self signed certificate

Basically, the git-client plugin in jenkins is using a different config file than the git.exe itself is using. The config I had to adapt was located at

C:\Program Files\Git\mingw64\etc\.gitconfig

Also please note that you should not disable the ssl verification but instead tell git where to find information about the self signed certificate to make it work. You can find the general instructions in the question at the given link.

Solution 2

Make sure you have set

  1. Set Git path in Manage Jenkin>Global tool configuration
  2. Set Credential for the URL: If you are using HTTPS git repo URL then use your git credential, if you are using SSH then go with certificates

Additionally, Although you have ran the command,

git config http.sslVerify "false",

In local git bash, it will not effect jenkin.

You can remove this error in Jenkin, first create a new free style project and just add "Window Batch Command" in Build step add command

git config http.sslVerify "false"

and save it and ran the job.

Once this is done, your Jenkin is configured to bypass the ssl verification. Now you can remove this build step and try to clone the project in SCM.

.

Share:
11,295
Admin
Author by

Admin

Updated on June 15, 2022

Comments

  • Admin
    Admin almost 2 years

    We have newly installed Jenkins and Bitbucket server which are running with native self signed certificates.

    When I try to clone the repository with windows command prompt it is getting cloned. I have already disabled the http.sslverify to false in git. enter image description here

    But the problem is when I try to clone using Git under source code management in Jenkins I see following error and build also fails with same error. enter image description here

    I am using following plugin version in Jenkins: Git Client Plugin version=2.4.6 Git Plugin version=3.3.1

    Git path in Jenkins: enter image description here

  • Artur
    Artur over 4 years
    To make this work I needed to use git config with global: git config --global http.sslVerify false