1

I have been doing a git clone of a repository in Gitlab through an azure pipeline and it showed the following error:

2020-08-13T11:23:42.2930076Z ##[warning]Git fetch failed with exit code 128, back off 6.913 seconds before retry.
2020-08-13T11:23:49.1339276Z ##[command]git fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin
2020-08-13T11:23:49.3214993Z fatal: unable to access 'https://*****/gitlab/****/web.git/': SSL certificate problem: unable to get local issuer certificate

How could I resolve this issue?

Jean-Francois T.
  • 11,549
  • 7
  • 68
  • 107
  • This problem usually occurs on `self-hosted agents`. If you use this kind of agnet, you can refer to the following answer to solve the problem. If not, you share your `agent type` `gitlab verification method`. – Kevin Lu-MSFT Aug 14 '20 at 02:34
  • I am using agent pull "Azure Pipelines". – Rakesh Kumar Routray Aug 19 '20 at 03:15
  • 1
    Till now i am unable to clone from gitlab ....my main challenge how to handle "git config --global http.sslVerify false" this command in azure devops pipeline – Rakesh Kumar Routray Aug 19 '20 at 03:19
  • In Azure Pipeline, you could add a `Command line ` task to run this script. Could you please help me check if this issue exists in the Checkout step? If yes, this method may not be suitable. By the way , I tested with `Azure Pipelines ->vs2017-win2016` and it could work. – Kevin Lu-MSFT Aug 19 '20 at 03:26
  • @RakeshKumarRoutray did you fix the issue? – Raf Dec 06 '21 at 11:13

1 Answers1

1

SSL certificate problem: unable to get local issuer

From the error log, this problem often occurs when using self-hosted agent.

This error occurs when a self-signed certificate cannot be verified.

You could running the following script on your local machine to turn off sslVerify .

git config --global http.sslVerify false

On the other hand , you could configure the git certificate.

  1. Add Enterprise CA certificate to git config –global http.sslCAInfo.

  2. Tell Git where to find the CA bundle by running:

    git config --system http.sslCAPath / absolute / path / to / git / certificates

or copying the CA bundle to the /bin directory and adding the following to the gitconfig file:

sslCAinfo = /bin/curl-ca-bundle.crt
  1. Restart the agent.

Try following the tutorial which mentioned in blog.

Here is a ticket about Unable to resolve “unable to get local issuer certificate” using git on Windows with self-signed certificate

Kevin Lu-MSFT
  • 20,786
  • 3
  • 19
  • 28
  • 1
    but how to add this ssl false command in azure devops pipeline ? Could you please help me ? – Rakesh Kumar Routray Aug 19 '20 at 03:12
  • @RakeshKumarRoutray if you have a fixed machine, run this command once in your machine and it will stay. If the VM is a clean one each time, you can add a task "Command Line" before the git clone to disable the SSL – Jean-Francois T. Apr 19 '21 at 07:16