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.
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.
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:
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.
I am behind corporate firewall and Jenkins was missing the certificate of Bitbucket in its java trust-store "$JAVA_HOME/jre/lib/security/cacerts" or "$Jenkins_home/jre/lib/security/cacerts" (depends on which Java executable you are using in 'jenkins.xml' file).
Make sure you have set
- Set Git path in Manage Jenkin>Global tool configuration
- 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.
.