error message "unable to get local issuer certificate" when cloning a project from github to RStudio
Asked Answered
L

6

6

I was trying to clone a github's repo from RStudio. I have configured git as version control executable.

I got this error message:

SSL certificate problem: unable to get local issuer certificate.

What do I have to do?

Thanks

Labelle answered 31/5, 2016 at 16:35 Comment(0)
A
11

Use following Steps:

  1. Go to github site "www.github.com"

  2. click on the Lock icon "View Site Information" near the Address bar.

  3. Click on the certificate option (ensure its showing valid)

  4. Go to Certification path tab, DOUBLE CLICK on the root icon (certificate) of the certificate path

  5. Go to details tab, and click on Copy to file button

  6. Specify a full path with file name whatever you want to save it as (Eg. D:\gitCert.cer)

  7. Open git bash and execute following commands stepwise,

    $ git config http.sslCAInfo
    
    $ git config --global http.sslBackend "openssl"
    
    $ git config --global http.sslCAInfo "D:\gitCert.cer"
    
  8. try to connect to the github server by pushing your changes or cloning some repo.

    $ git push -u origin master
    
Agadir answered 16/1, 2019 at 14:0 Comment(0)
S
5

I was facing the same error message and the thread at https://github.com/desktop/desktop/issues/9293 got me to try the command git config --global http.sslbackend schannel which resolved the issue.

Singlehearted answered 2/6, 2022 at 7:24 Comment(0)
C
4

Are you currently connecting from a corporate network? Some firewall settings have been known to cause issues.

But first for a quick solution, try entering the following in Command Prompt

git config --global url."https://".insteadOf git://

That has been known to help a lot of people seeing the same issue.

If the above does not work, you will need to add your certificate to list of trusted certificates in Git.

1) Navigate to https://github.com

2) If using Chrome or IE, click the padlock icon in the URL for more details

a. Chrome: Click Details, and then ‘View Certificate’ in the sidebar that opens

b. IE: Click ‘View Certificates’

3) In the ‘Certificate’ window, navigate to the ‘Certification Path’ tab

4) Double click the ‘root’ certificate at the top of the list

5) On the new ‘Certificate’ window, navigate to the ‘Details’ tab

6) Click ‘Copy to File’

a. Select Base-64 encoded X.509 (.CER), then click next

b. Save to desired location (i.e. Desktop/tempcert.cer), then click next

c. Click finish, and now the certificate should be saved at provided destination

d. Right click the newly saved cert and open with a text editor (Visual Code was used, so either ‘Code’ or a similar text editor may be required)

7) Navigate to the directory within ‘Git/’ that contains ‘ca-cert-bundle.crt’

8) Right click ‘ca-cert-bundle.crt’ and choose to edit

9) Copy ALL of the contents from the certificate you saved and opened earlier, everything between and including: ‘-----BEGIN TRUSTED CERTIFICATE-----‘ to ‘---- -END TRUSTED CERTIFICATE-----‘

10) Paste these contents to the end of the ‘ca-cert-bundle.crt’ file and save.

a. Saving to this location may be restricted, if so, choose to ‘Save As’ and save the file as ‘ca-cert-bundle.new.crt’ in any location that you have access to. If it is not restricted, skip to step 15

11) Navigate the location you just saved ‘ca-cert-bundle.new.crt’ to, and copy/cut the file

12) Paste the file in the Git directory containing ‘ca-cert-bundle.crt’

a. You will be prompted for admin permission to paste this file here

13) Rename ‘ca-cert-bundle.crt’ to ‘ca-cert-bundle.old.crt’

a. Provide admin permission if prompted

14) Rename ‘ca-cert-bundle.new.crt’ to ‘ca-cert-bundle.crt’

a. Provide admin permission if prompted

15) Retry either cloning from the git repo or restoring bower dependencies. The task should now complete successfully!

Cavorilievo answered 23/1, 2017 at 16:12 Comment(1)
This is helpful. I just copied the cert from the github.com and added to the ca-cert-bundle.crt for GIT and it resolved my issue. Thank you!Paillette
F
0

one of the easiest way is to unset the proxy.

Command : git config --global --unset http.proxy

Footrope answered 17/11, 2020 at 11:18 Comment(0)
R
0

This help in telling git to not perform the validation of the certificate using the global option

git config --global http.sslVerify false

But this is not the advised one, please consider using certificates

 git config http.sslCAInfo
 git config --global http.sslBackend "openssl"
 git config --global http.sslCAInfo "<git_cert>"
Reliance answered 19/5, 2021 at 16:48 Comment(0)
D
0

Open Git Bash and run the command if you want to completely disable SSL verification.

git config --global http.sslVerify false

Note: This solution opens you to attacks like man-in-the-middle attacks. Therefore turn on verification again as soon as possible:

git config --global http.sslVerify true
Depart answered 4/8, 2021 at 19:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.