We have a Jenkins build job that executed an ANT target that perform a git clone/pull (We are not using the Jenkins Git plugin).
<macrodef name="git">
<attribute name="command" />
<attribute name="dir" default="" />
<element name="args" optional="true" />
<sequential>
<echo message="git @{command}" />
<exec executable="git" dir="@{dir}">
<arg value="@{command}" />
<args/>
</exec>
</sequential>
</macrodef>
<macrodef name="git-clone-pull">
<attribute name="repository" />
<attribute name="dest" />
<sequential>
<git command="clone">
<args>
<arg value="@{repository}" />
<arg value="@{dest}" />
</args>
</git>
<git command="pull" dir="@{dest}" />
</sequential>
</macrodef>
<target name="clone-pull-git-repository">
<echo message="# Cloning '${git.repository}':" />
<git-clone-pull
repository="https://${git.user}:${git.password}@${git.repository.url}/grsbrms/${git.repository}"
dest="${git.repository.dir}/${git.repository}" />
</target>
And we are seeing the following error after the recent Bitbucket migration.
[echo] git pull
[exec] fatal: unable to access 'https://TestUser:xyz@bitbucket.somecorp.com/scm/grs-brms-payroll-xom/': SSL certificate problem: unable to get local issuer certificate
We have tried importing the ssl cert from the website to the JVM:
keytool -import -alias SV12345 -keystore %JAVA_HOME%\jre\lib\security\cacerts -file C:\Temp\bitbucket.cer
And also added the certificate to the Jenkins startup script:
-Djavax.net.ssl.trustStore=%JENKINS_HOME%\.cacerts\cacerts
-Djavax.net.ssl.trustStorePassword=changeit
Is it possible to resolve this issue without having to turn off SSL validation for git system wide?
i.e. git config --system http.sslVerify false
Thank you