summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2015-12-29 14:39:53 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2015-12-29 14:39:53 +0100
commit1ba1e35fbed820ec9d9e1dafbe150f88f29342d8 (patch)
tree4234d6953003b09e584f7fbb754244c800d44cf9
parentad9aaa460e2fa446b08124bd8df846e1471c030b (diff)
downloademacs-1ba1e35fbed820ec9d9e1dafbe150f88f29342d8.tar.gz
Refactor out gnutls-trustfiles
* lisp/net/gnutls.el (gnutls-trustfiles): Refactor out for reuse by tls.el.
-rw-r--r--lisp/net/gnutls.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/net/gnutls.el b/lisp/net/gnutls.el
index ccaef8aafac..a7321da854c 100644
--- a/lisp/net/gnutls.el
+++ b/lisp/net/gnutls.el
@@ -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)
- gnutls-trustfiles)))))
+ (trustfiles (or trustfiles (gnutls-trustfiles)))
(priority-string (or priority-string
(cond
((eq type 'gnutls-anon)
@@ -251,6 +246,14 @@ defaults to GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT."
process))
+(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)
+ gnutls-trustfiles))))
+
(declare-function gnutls-error-string "gnutls.c" (error))
(defun gnutls-message-maybe (doit format &rest params)