From 6c4081f78510a09612473864ceffe90e5cf15cc2 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 27 Mar 2020 21:30:07 -0400 Subject: [PATCH] Refactor gnutls-algorithm-priority And prevent void-variable error if gnutls is, for some reason, unavailable or libgnutls-version isn't a numeric. --- core/core.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/core.el b/core/core.el index d9c27eaa7..1e1099663 100644 --- a/core/core.el +++ b/core/core.el @@ -191,8 +191,9 @@ users).") ;; least a little more discerning. (setq gnutls-verify-error (not (getenv "INSECURE")) gnutls-algorithm-priority - (let ((support-tls1.3 (if (>= libgnutls-version 30605) ":+VERS-TLS1.3" nil))) - (concat "SECURE128:+SECURE192:-VERS-ALL:+VERS-TLS1.2" support-tls1.3)) + (concat "SECURE128:+SECURE192:-VERS-ALL:+VERS-TLS1.2" + (if (ignore-errors (>= libgnutls-version 30605)) + ":+VERS-TLS1.3")) ;; `gnutls-min-prime-bits' is set based on recommendations from ;; https://www.keylength.com/en/4/ gnutls-min-prime-bits 3072