Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I get the following error when accessing Github over HTTPS:

error: server certificate verification failed. 
CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

This is because I don't have any certificates in /etc/ssl/certs/. I know how to fix this problem. I can install the package ca-certificates from Debian repository. The problem is, however, that this will install all certificates (thousands) which I don't necessarily want to accept/trust.

How can I install certificate for Github only?

a Subproblem/Subquestion

On another machine, where the package ca-certificates is already installed and git works, I have noticed that some certificates in /etc/ssl/certs/ are one-certificate-per-file and other are many-certificates-in-one-file. The particular file containing Github certificate, /etc/ssl/certs/ca-certificates.crt contains over 150 other certificates:

$ grep 'BEGIN CERTIFICATE' /etc/ssl/certs/ca-certificates.crt | wc -l
159

How can I find which one out of these 159 certificate is the one I need? (other than brute force - slicing the file in halves and checking both halves, repeating while n > 1).

share|improve this question
    
What are you trying to accomplish? Contacting GitHub programmatically? –  Nate W. Jan 25 at 7:12
add comment

1 Answer

In order to access your Github you need to do it via ssh. So you need to add your ssh public key to github. After that you are able to access github via ssh i.e.:

git init git@github.com:yourname/yourrepo.git

See also: Github: generating ssh keys, WikiHow

[Edit #1]

without certificate checks:

GIT_SSL_NO_VERIFY=true git clone https://github.com/p/repo.git

For me it is still not clear what are you asking for, because you know that installing ca-certificates will fix the problem.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.