简体   繁体   中英

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

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

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

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 (ie 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!

我遇到了同样的错误消息,并且https://github.com/desktop/desktop/issues/9293上的线程让我尝试了解决问题的命令git config --global http.sslbackend schannel

one of the easiest way is to unset the proxy.

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

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>"

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM