Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant clone from GitHub : SSL certificate problem: unable to get local issuer certificate #9293

Closed
dineshdixitgit opened this issue Mar 16, 2020 · 40 comments
Labels
support Issues likely related to one person's environment or configuration

Comments

@dineshdixitgit
Copy link

Describe the feature or problem you’d like to solve

DINESH.DIXIT@LP-B1NY0Z2 MINGW64 /c/code/GitHub2
$ git clone https://github.com/dineshdixitgit/meta-api.git
Cloning into 'meta-api'...
fatal: unable to access 'https://github.com/dineshdixitgit/meta-api.git/': SSL certificate problem: unable to get local issuer certificate

A clear and concise description of what the feature or problem is.

Proposed solution

How will it benefit Desktop and its users?

Additional context

Add any other context like screenshots or mockups are helpful, if applicable.

@steveward
Copy link
Member

@dineshdixitgit this error can be caused by a few things -- are you running any security software on your machine that could be interfering with your connection to GitHub? Some security software will man-in-the-middle your connection.

You can also check out this issue thread #3684 for some specific steps to debug this issue. To check if there are any configuration issues on your machine it would be helpful if you could open up Git for Windows and run the following command:

git config -l --show-origin

Let me know the output of that.

@steveward steveward added the support Issues likely related to one person's environment or configuration label Mar 16, 2020
@dineshdixitgit
Copy link
Author

dineshdixitgit commented Mar 17, 2020 via email

@steveward
Copy link
Member

@dineshdixitgit it looks like you have http.sslbackend set to openssl, which means GitHub Desktop isn't using the Windows certificate store. Running the command git config --global http.sslBackend schannel should resolve this issue and allow your stored certificate to be picked up. Let me know if that doesn't get things working.

@dineshdixitgit
Copy link
Author

Hi Steve,
Both openchannel and schannel gave me errors as below. Please suggest-

$ git config --global http.sslBackend "openssl"
$ git clone https://github.com/wmgdsp/gcdm-api.git gcdm-api-test
Cloning into 'gcdm-api-test'...
fatal: unable to access 'https://github.com/wmgdsp/gcdm-api.git/': SSL certificate problem: unable to get local issuer certificate

$ git config --global http.sslBackend "schannel"
$ git clone https://github.com/wmgdsp/gcdm-api.git gcdm-api-test
Cloning into 'gcdm-api-test'...
fatal: unable to access 'https://github.com/wmgdsp/gcdm-api.git/': schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.

@steveward
Copy link
Member

The 'revocation' error is usually caused by your network blocking the attempt by Windows to check the revocation status of a certificate, which then causes the whole operation to error. You can find a workaround for this issue here:

https://github.com/desktop/desktop/blob/development/docs/known-issues.md#certificate-revocation-check-fails---3326

Let me know if that doesn't get things working for you.

@rajivsharma2022
Copy link

D:\Rajiv\microservice>git config -l --show-origin
file:"C:\ProgramData/Git/config" core.symlinks=false
file:"C:\ProgramData/Git/config" core.autocrlf=true
file:"C:\ProgramData/Git/config" core.fscache=true
file:"C:\ProgramData/Git/config" color.diff=auto
file:"C:\ProgramData/Git/config" color.status=auto
file:"C:\ProgramData/Git/config" color.branch=auto
file:"C:\ProgramData/Git/config" color.interactive=true
file:"C:\ProgramData/Git/config" help.format=html
file:"C:\ProgramData/Git/config" http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
file:"C:\ProgramData/Git/config" diff.astextplain.textconv=astextplain
file:"C:\ProgramData/Git/config" rebase.autosquash=true
file:"C:\Program Files\Git\mingw64/etc/gitconfig" credential.helper=manager
file:C:/Users/RA346186/.gitconfig user.name=Rajiv
file:C:/Users/RA346186/.gitconfig user.email=rajiv.sharma8@wipro.com

@rajivsharma2022
Copy link

I have the above settings and not able to clone too

@steveward
Copy link
Member

@rajivsharma2022 are you encountering the unable to get local issuer certificate error? It'd be helpful if you could open a new issue and upload your log file from GitHub Desktop.

@KDS717
Copy link

KDS717 commented Apr 20, 2021

HI @steveward,
I tried : git config --global http.sslBackend schannel
after this I tried cloning, and got this error
fatal: unable to access 'https://github.com/KDS717/Python.git/': schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.

@steveward
Copy link
Member

@KDS717 are you running any antivirus software on your system that could be causing this? We've seen specific antivirus software like Kaspersky cause this as well.

You can also skip the revocation check by running this command:

git config --global http.schannelCheckRevoke false

See this section of our known issues doc for reference.

@xavierluz
Copy link

I solved the error, follow the link
(https://stackoverflow.com/questions/16668508/how-do-i-configure-git-to-trust-certificates-from-the-windows-certificate-store/48212753#48212753)

@narendermann
Copy link

My issues resolved by applying git config --global http.sslBackend schannel

on git bash

@geologyrocks
Copy link

geologyrocks commented Jun 2, 2021

@KDS717 are you running any antivirus software on your system that could be causing this? We've seen specific antivirus software like Kaspersky cause this as well.

You can also skip the revocation check by running this command:

git config --global http.schannelCheckRevoke false

See this section of our known issues doc for reference.

This worked for me on my corporate machine - I was cloning from my own GitHub repo. I made sure to revert it to git config --global http.schannelCheckRevoke true once I was done, however :)

Edit: I would instead now recommend adding the -c http.sslVerify=false argument to your git command, e.g. git -c http.sslVerify=false pull or git -c http.sslVerify=false clone <some external Git repo> as the SSL permissions are only overridden temporarily, therefore eliminating the possibility of forgetting to re-enable http.schannelCheckRevoke true.

@j0131n
Copy link

j0131n commented Sep 26, 2021

@dineshdixitgit it looks like you have http.sslbackend set to openssl, which means GitHub Desktop isn't using the Windows certificate store. Running the command git config --global http.sslBackend schannel should resolve this issue and allow your stored certificate to be picked up. Let me know if that doesn't get things working.

Hi. Thanks to this, worked for me. My setup is: I have a VPN running which serves as a middleware ( company requirement ) and it blocks any access that's not listed on my policy.

@ksygramesh
Copy link

My issues resolved by applying git config --global http.sslBackend schannel

on git bash

@ksygramesh
Copy link

Yes.. Even my issue got resolved, after setting that one

@ThulasiKola
Copy link

excellent .. My Issue also resolved after settig git config --global http.sslBackend schannel

@ashleyjamesbrown
Copy link

Having same issue but using a MAC. Any thoughts as I dont get the same info when running
git config -l --show-origin

@geologyrocks
Copy link

geologyrocks commented Jan 6, 2022

@ashleyjamesbrown the best fix I found only yesterday - add a -c http.sslVerify=false argument to your git clone command.
e.g. git -c http.sslVerify=false clone https://github.com/AzureADQuickStarts/AppModelv2-NativeClient-DotNet.git

That way git knows to temporarily set the sslVerify property to false for the duration of the command. The same also works for git pull and git push (and any other git commands).

I now know you shouldn't do this!
git config --global http.sslBackend schannel is the right and safest way.

@ashleyjamesbrown
Copy link

remote: Password authentication is not available for Git operations.
remote: You must use a personal access token or SSH key.

I think tis the enterprise (work) account so ill see if its that

@geologyrocks
Copy link

Ok, good luck.

@ashleyjamesbrown
Copy link

Yup - last thing i had to do was make a PAT instead of using my github password.

Then i used the line above from you and it worked. Thanks so much.

git -c http.sslVerify=false clone https://mygithubrepo

remote: Enumerating objects: 48, done.
remote: Total 48 (delta 0), reused 0 (delta 0), pack-reused 48
Unpacking objects: 100% (48/48), done.

@GuiFV
Copy link

GuiFV commented Jul 12, 2022

If this happened after you installed a python version manually, inside the python app folder, double click on the "Install Certificates.command" file and it should fix it.

@taozuhong
Copy link

Solved with follow command:
git config --global http.sslVerify false

@hmy1215
Copy link

hmy1215 commented Oct 25, 2022

Solved the question with follow cmd:
git config --global http.sslVerify false

@KreciSie
Copy link

KreciSie commented Nov 5, 2022

Applied changes to git with code below to solve this error:

git config --global http.sslVerify false

@TamarShayo
Copy link

Cloning into 'ToDoList-Core'...
fatal: unable to access 'https://github.com/TamarShayo/ToDoList-Core.git/': SSL certificate problem: unable to get local issuer certificate
what the problem?

@steveward
Copy link
Member

@TamarShayo if you look at my first two comments in this issue you can follow those steps to see if that could be the cause of your SSL issues.

@aamirali5
Copy link

@dineshdixitgit it looks like you have http.sslbackend set to openssl, which means GitHub Desktop isn't using the Windows certificate store. Running the command git config --global http.sslBackend schannel should resolve this issue and allow your stored certificate to be picked up. Let me know if that doesn't get things working.

Thank you!
That worked.

@ShivaSEO
Copy link

If you're encountering an SSL certificate problem while trying to clone a repository from GitHub, the issue is likely related to the SSL certificate configuration on your system. This error message often indicates that Git is unable to verify the authenticity of the SSL certificate presented by the GitHub server. Here are some steps you can take to resolve the issue:

Update Git:
Ensure that you have the latest version of Git installed on your system. Old versions of Git might have issues with SSL certificate validation. Visit the official Git website to download and install the latest version: https://git-scm.com/

Check System Date and Time:
Make sure that the date and time settings on your system are correct. SSL certificates are time-sensitive, and an incorrect date/time might lead to validation issues.

Configure Git to Use the System Certificate Store (Windows Only):
If you're using Git on Windows, you can configure it to use the system certificate store, which may help resolve SSL certificate problems. Open a command prompt and run the following command:

git config --global http.sslBackend schannel

Reinstall Git Certificate Authorities (Windows Only):
On Windows, Git relies on a specific set of trusted Certificate Authorities (CAs). Sometimes, these certificates can become outdated or corrupted. You can try reinstalling Git for Windows to refresh these certificates:

Download the latest version of Git for Windows from: https://git-scm.com/download/win
Run the installer and select the same installation path as your current Git installation (to overwrite the existing installation).
Choose the appropriate options during the installation.

Use SSH Instead of HTTPS (Recommended):
Instead of using HTTPS to clone a repository, consider using SSH. SSH is often more convenient and bypasses SSL certificate verification issues altogether. Follow GitHub's guide to set up SSH for Git: https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh

Check Proxy Settings:
If you are behind a proxy, ensure that your proxy settings are correctly configured for Git. Improper proxy settings can interfere with SSL certificate verification. Use the following command to check your current proxy settings in Git:

git config --global --get http.proxy git config --global --get https.proxy
If you see any proxy settings that shouldn't be there, you can clear them using:

git config --global --unset http.proxy git config --global --unset https.proxy
Disable SSL Verification (Not Recommended):
This is not recommended for security reasons, but as a last resort, you can disable SSL certificate verification in Git with the following command:
git config --global http.sslVerify false
Note that disabling SSL verification is not a secure solution and should only be used temporarily for debugging purposes. It's essential to fix the underlying issue to ensure secure connections.

If none of the above solutions work, there might be other network-related issues or firewall configurations interfering with the connection. In that case, you may want to consult with your network administrator or internet service provider for further assistance.

@abhiverma001
Copy link

Hi, I was getting the same ssl related issue while cloning the repo on local system, post running below command my this issue got fixed.
git config --global http.sslBackend schannel

@mahavirdarbar
Copy link

mahavirdarbar commented Dec 22, 2023

I have the same issue but it's in runner. My issue disappeared after restarting my server. For further information about the problem, click this link. https://vishalvyas.com/gitlab-unable-to-get-local-issuer-certificate

@Rayisabc
Copy link

git config --global http.sslBackend schannel

@ArielisGT
Copy link

"I would instead now recommend adding the -c http.sslVerify=false argument to your git command"

@geologyrocks I wrote exactly the same argument in my corporate machine and worked! THX

@geologyrocks
Copy link

"I would instead now recommend adding the -c http.sslVerify=false argument to your git command"

@geologyrocks I wrote exactly the same argument in my corporate machine and worked! THX

I have since learned the error of my ways this is now the right way to do it (as @Rayisabc suggested):
git config --global http.sslBackend schannel

@sarthak-972
Copy link

Describe the feature or problem you’d like to solve

DINESH.DIXIT@LP-B1NY0Z2 MINGW64 /c/code/GitHub2 $ git clone https://github.com/dineshdixitgit/meta-api.git Cloning into 'meta-api'... fatal: unable to access 'https://github.com/dineshdixitgit/meta-api.git/': SSL certificate problem: unable to get local issuer certificate

A clear and concise description of what the feature or problem is.

Proposed solution

How will it benefit Desktop and its users?

Additional context

Add any other context like screenshots or mockups are helpful, if applicable.

What is the solution of this problem? (i don't know because i am a beginner.)

@hkalsait19
Copy link

Hi Team,

We got same error as given above,

PS C:\Users\user\Documents\terraform-with-git> git clone https://github.com/hkalsait19/terraform-learn.git
Cloning into 'terraform-learn'...
fatal: unable to access 'https://github.com/hkalsait19/terraform-learn.git/': SSL certificate problem: unable to get local issuer certificate
PS C:\Users\user\Documents\terraform-with-git> 

Successfully resolved error after run these commands:

  1. git config -l --show-origin
  2. git config --global http.sslBackend schannel

After command got run successfully, I can clone the repository from GitHub.

PS C:\Users\user\Documents\terraform-with-git> git config --global http.sslBackend schannel
PS C:\Users\user\Documents\terraform-with-git> 
PS C:\Users\user\Documents\terraform-with-git>
PS C:\Users\user\Documents\terraform-with-git> git clone https://github.com/hkalsait19/terraform-learn.git
Cloning into 'terraform-learn'...
remote: Enumerating objects: 175, done.
remote: Counting objects: 100% (18/18), done.
remote: Compressing objects: 100% (15/15), done.
Receiving objects:  86% (151/175)
Receiving objects: 100% (175/175), 59.36 KiB | 9.89 MiB/s, done.
Resolving deltas: 100% (61/61), done.
PS C:\Users\user\Documents\terraform-with-git> 

Thank You all of you my friends those involved here...!!!

@FuSiYu666
Copy link

Hi Steve, Both openchannel and schannel gave me errors as below. Please suggest-

$ git config --global http.sslBackend "openssl" $ git clone https://github.com/wmgdsp/gcdm-api.git gcdm-api-test Cloning into 'gcdm-api-test'... fatal: unable to access 'https://github.com/wmgdsp/gcdm-api.git/': SSL certificate problem: unable to get local issuer certificate

$ git config --global http.sslBackend "schannel" $ git clone https://github.com/wmgdsp/gcdm-api.git gcdm-api-test Cloning into 'gcdm-api-test'... fatal: unable to access 'https://github.com/wmgdsp/gcdm-api.git/': schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.

you can try to run this:
git config --global --unset http.sslBackend

@johndjchan
Copy link

Hey, I've run into that SSL certificate issue before! It usually means your system doesn’t trust the certificate authority that issued the SSL certificate for GitHub. One quick fix is to update your Git installation to ensure it has the latest CA certificates. If you're using Windows, sometimes adding Git to the system PATH during installation helps. Alternatively, setting up your Git repo on Cloudways can make things smoother since their servers handle SSL certificates efficiently. Definitely check out this article for a deeper dive into solving these SSL certificate issues. Trust me, it’s super helpful!

@SjxSubham
Copy link

SjxSubham commented Oct 23, 2024

@KDS717 are you running any antivirus software on your system that could be causing this? We've seen specific antivirus software like Kaspersky cause this as well.

You can also skip the revocation check by running this command:

git config --global http.schannelCheckRevoke false

See this section of our known issues doc for reference.

after running this command i solved ssl issue but i'm still getting error it showing

fatal: unable to access 'https://github.com/hkalsait19/terraform-learn.git/': Failure when receiving data from the peer

How to resolve????

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Issues likely related to one person's environment or configuration
Projects
None yet
Development

No branches or pull requests