Commit 1ba1e35f authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen

Refactor out gnutls-trustfiles

* lisp/net/gnutls.el (gnutls-trustfiles): Refactor out for reuse by tls.el.
parent ad9aaa46
......@@ -193,12 +193,7 @@ defaults to GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT."
;; The gnutls library doesn't understand files delivered via
;; the special handlers, so ignore all files found via those.
(file-name-handler-alist nil)
(trustfiles (or trustfiles
(delq nil
(mapcar (lambda (f) (and f (file-exists-p f) f))
(if (functionp gnutls-trustfiles)
(funcall gnutls-trustfiles)
(trustfiles (or trustfiles (gnutls-trustfiles)))
(priority-string (or priority-string
((eq type 'gnutls-anon)
......@@ -251,6 +246,14 @@ defaults to GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT."
(defun gnutls-trustfiles ()
"Return a list of usable trustfiles."
(delq nil
(mapcar (lambda (f) (and f (file-exists-p f) f))
(if (functionp gnutls-trustfiles)
(funcall gnutls-trustfiles)
(declare-function gnutls-error-string "gnutls.c" (error))
(defun gnutls-message-maybe (doit format &rest params)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment