mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-26 06:18:07 -05:00
download: Load *.crt certificate bundles when *.pem files are missing.
Fixes <https://bugs.gnu.org/38254>. * guix/build/download.scm (make-credendials-with-ca-trust-files): Look for *.crt files under DIRECTORY when *.pem files cannot be found.
This commit is contained in:
parent
5544f1e3ea
commit
0d78d0f09c
1 changed files with 8 additions and 5 deletions
|
@ -187,10 +187,13 @@ (define (make-credendials-with-ca-trust-files directory)
|
|||
DIRECTORY. Those authority certificates are checked when
|
||||
'peer-certificate-status' is later called."
|
||||
(let ((cred (make-certificate-credentials))
|
||||
(files (or (scandir directory
|
||||
(lambda (file)
|
||||
(string-suffix? ".pem" file)))
|
||||
'())))
|
||||
(files (match (scandir directory (cut string-suffix? ".pem" <>))
|
||||
((or #f ())
|
||||
;; Some distros provide nothing but bundles (*.crt) under
|
||||
;; /etc/ssl/certs, so look for them.
|
||||
(or (scandir directory (cut string-suffix? ".crt" <>))
|
||||
'()))
|
||||
(pem pem))))
|
||||
(for-each (lambda (file)
|
||||
(let ((file (string-append directory "/" file)))
|
||||
;; Protect against dangling symlinks.
|
||||
|
@ -198,7 +201,7 @@ (define (make-credendials-with-ca-trust-files directory)
|
|||
(set-certificate-credentials-x509-trust-file!*
|
||||
cred file
|
||||
x509-certificate-format/pem))))
|
||||
(or files '()))
|
||||
files)
|
||||
cred))
|
||||
|
||||
(define (peer-certificate session)
|
||||
|
|
Loading…
Reference in a new issue