unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Alexis <flexibeast@gmail.com>
Cc: 38602@debbugs.gnu.org
Subject: bug#38602: 26.3; gnutls-negotiate fails to handle :verify-error being set to t
Date: Sat, 14 Dec 2019 13:59:19 +0100	[thread overview]
Message-ID: <m24ky3ukpk.fsf@gmail.com> (raw)
In-Reply-To: <875zijbq2z.fsf@ada> (Alexis's message of "Sat, 14 Dec 2019 13:25:56 +1100")

>>>>> On Sat, 14 Dec 2019 13:25:56 +1100, Alexis <flexibeast@gmail.com> said:

    Alexis> When establishing a connection to an XMPP server, jabber.el ends up
    Alexis> calling `gnutls-negotiate' with :verify-error set to `t'. When
    Alexis> `gnutls-negotiate' calls `gnutls-boot-parameters', the lines:

    Alexis>    (when verify-hostname-error
    Alexis>      (push :hostname verify-error))

    Alexis> in the latter create a dotted list rather than a proper list,
    Alexis> resulting in jabber.el returning the error message:

    Alexis>    connection lost: 'STARTTLS negotiation failed: Wrong type
    Alexis>    argument: listp, (:hostname . t)'

Thatʼs a misleading error message. Itʼs not a proper list, as you say,
but it *is* a list.

How about this? Producing a list (:hostname t) is not what you want,
since that removes the 'check everything' feature of specifying just
't'.

diff --git a/lisp/net/gnutls.el b/lisp/net/gnutls.el
index 9b13adaefe..14368bc298 100644
--- a/lisp/net/gnutls.el
+++ b/lisp/net/gnutls.el
@@ -345,8 +345,11 @@ gnutls-boot-parameters
                             (t nil))))
          (min-prime-bits (or min-prime-bits gnutls-min-prime-bits)))
 
-    (when verify-hostname-error
-      (push :hostname verify-error))
+    ;; Only add :hostname if `verify-error' is not t, since t
+    ;; means "include :hostname" Bug#38602.
+    (and verify-hostname-error
+         (not (eq verify-error t))
+         (push :hostname verify-error))
 
     `(:priority ,priority-string
                 :hostname ,hostname





  reply	other threads:[~2019-12-14 12:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-14  2:25 bug#38602: 26.3; gnutls-negotiate fails to handle :verify-error being set to t Alexis
2019-12-14 12:59 ` Robert Pluim [this message]
2019-12-26  4:19   ` Alexis
2019-12-29 21:01     ` Robert Pluim
2020-08-16  6:59       ` Alexis
2020-10-02  2:51     ` Lars Ingebrigtsen
2020-12-08 18:12       ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m24ky3ukpk.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=38602@debbugs.gnu.org \
    --cc=flexibeast@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).