Resolve SSL certificate error with Git » History » Version 5
Redmine Admin, 08/06/2014 11:01 AM
1 | 1 | Redmine Admin | h1. Certificate handling with GIT |
---|---|---|---|
2 | |||
3 | |||
4 | GIT uses cURL internally for transfering files. Unfortunately cURL uses its own certificate-store |
||
5 | and the certificate-chain (Telekom-CA-->DFN-CA-->TU-Clausthal) isn't included by default. |
||
6 | |||
7 | Now, when you try to access a GIT-repository you will get an error similar to this: |
||
8 | <pre> |
||
9 | git clone https://scm.in.tu-clausthal.de/git/testgit |
||
10 | Cloning into 'testgit'... |
||
11 | error: server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none while accessing https://scm.in.tu-clausthal.de/git/testgit/info/refs |
||
12 | </pre> |
||
13 | |||
14 | 2 | Redmine Admin | This is because by default cURL does not know the used certificate chain and rejects the GIT operation. |
15 | There are several possibilities to avoid this |
||
16 | 5 | Redmine Admin | |
17 | h3# and the good and secure one which requires to install the certificate chain used here. |
||
18 | h3# the [[bad and insecure method]] which are based on the fact that GIT/cURL bypasses the SSL certificate verification. |
||
19 | 2 | Redmine Admin | |
20 | 1 | Redmine Admin | To import the certificate chain for GIT follow these steps: |
21 | 1. Locate the file |
||
22 | |||
23 | https://pki.pca.dfn.de/tu-clausthal-ca/pub/cacert/chain_sha1.txt |
||
24 | To import the certificate chain for GIT follow these steps: |
||
25 | |||
26 | |||
27 | or choose one of the following options to skip the certificate verification: |
||
28 | - Temporary ignore ssl certificate verification: |
||
29 | env GIT_SSL_NO_VERIFY=true git clone https://scm.in.tu-clausthal.de/git/PROJECTNAME |
||
30 | |||
31 | - Disable ssl verfication for one GIT repository (works after first clone): |
||
32 | git config http.sslVerify false |
||
33 | |||
34 | - Globally disable ssl verification (not recommended!) |
||
35 | git config --global http.sslVerify false |