aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-09-29 09:44:37 +0200
committerLudovic Courtès <ludo@gnu.org>2017-09-29 09:46:23 +0200
commit9cfea9fe2e3ca6a3d1b832a6ec217426ec973c93 (patch)
tree0d0053d15d12dfe848b15dcd20d1e56ba00886b1 /src
parent2a4d493e28100b8eca7d23300dd872c9f99e1f16 (diff)
downloadcuirass-9cfea9fe2e3ca6a3d1b832a6ec217426ec973c93.tar
cuirass-9cfea9fe2e3ca6a3d1b832a6ec217426ec973c93.tar.gz
Do not mistakenly use 'GIT_SSL_CAINFO' as a directory name.
'GIT_SSL_CAINFO' designates a single-file certificate bundle, not a directory; thus it must be passed as the second argument to 'set-tls-certificate-locations!'. * src/cuirass/base.scm (process-specs): Pass $SSL_CERT_DIR as the first argument to 'set-tls-certificate-locations!', and $GIT_SSL_CAINFO or $SSL_CERT_FILE as the second argument.
Diffstat (limited to 'src')
-rw-r--r--src/cuirass/base.scm12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm
index d1c8282..960a5e7 100644
--- a/src/cuirass/base.scm
+++ b/src/cuirass/base.scm
@@ -255,10 +255,14 @@ directory and the sha1 of the top level commit in this directory."
(let ((stamp (db-get-stamp db spec)))
;; Catch and report git errors.
(with-git-error-handling
- (let ((certs (or (getenv "GIT_SSL_CAINFO")
- (getenv "SSL_CERT_DIR"))))
- (when certs
- (set-tls-certificate-locations! certs)))
+ ;; Try the 'GIT_SSL_CAINFO' or 'SSL_CERT_FILE' file first, then
+ ;; search the 'SSL_CERT_DIR' directory.
+ (let ((directory (getenv "SSL_CERT_DIR"))
+ (file (or (getenv "GIT_SSL_CAINFO")
+ (getenv "SSL_CERT_FILE"))))
+ (when (or directory file)
+ (set-tls-certificate-locations! directory file)))
+
(receive (checkout commit)
(fetch-repository store spec)
(when commit