I have a problem... My code in Gitlab, Pipeline in Azure DevOps. I use classic editor. When i start pipeline i have error "fatal: unable to access 'fatal: unable to access 'https://my.repos.example:***.git/': SSL certificate problem: unable to get local issuer certificate" Please help me!
-
From what I can tell it cannot verify your certificate. One thing you could do (not necessarily recommending it) is found here: https://confluence.atlassian.com/bitbucketserverkb/ssl-certificate-problem-unable-to-get-local-issuer-certificate-816521128.html which is to turn off the verification via git command. – Mike Cheel Jun 14 '21 at 19:21
-
1yes, but in azure devops i cant do this... – kostukp96 Jun 14 '21 at 20:04
-
https://docs.microsoft.com/en-us/azure/devops/pipelines/scripts/git-commands?view=azure-devops&tabs=yaml – Mike Cheel Jun 14 '21 at 21:00
-
i dont understand how this can help me ? I use classic editor, and every time first step is clone repo... – kostukp96 Jun 15 '21 at 06:56
-
I didn't know the exact answer but as you figured out it has to do with turning off verification (somehow) of the ssl verification which was what I was trying to point you to. I just knew there was at least one way to do it. – Mike Cheel Jun 15 '21 at 18:56
4 Answers
Note: You could disable SSL certificate validation in Git or tick the checkbox
accept untrusted SSL certificates, but that is definitely not the preferred practice for security.
In my case, I had Github enterprise repository which was giving this error. Try below steps:
- Enable
gitto useschannel:git config --global http.sslbackend schannel - Export the certificates from your browser in the
Base-64 encoded X.509 (.CER)format.
Note: In case of windows os, you can import
.p7bfiles by right clicking the > install certificates.
Repeat the step-2 for all the intermediate certificate chain.
Copy and append all the certificates as obtained above.
Find out the Certificate store of the
git:git config --list --show-scopeThe path will be mentioned in system scopehttp.sslcainfo.Using a text editor (Notepad++) open
ca-bundle.crtand copy paste the certificates from step-4 to the end of theca-bundle.crtfile and click Save.
Now retry the pipeline run.
- 143
- 1
- 1
- 12
For me this issue came up when attempting to clone a repository through Visual Studio 2019. Upon selecting the Azure option in the repository menu I then picked the codebase I wanted to clone. After this step I was prompted with an error of:
"SSL certificate problem: unable to get local issuer certificate"
I ran the git command setting up the global ssl backend:
> git config --global http.sslbackend schannel
And the next time I tried the steps listed above, all was well.
If you want to cancel check azure devops ssl certificate, you need to go a variable group your pipeline and add GIT_SSL_NO_VERIFY = 1
- 167
- 2
- 7
-
Although this works, but this is unsecure way of doing it. There are [some posts](https://stackoverflow.com/questions/23885449/unable-to-resolve-unable-to-get-local-issuer-certificate-using-git-on-windows?rq=1) describe how to add `.cer` files to git store. But personally couldn't figured it out. – Rajesh Swarnkar Feb 01 '22 at 09:01