From: Ted Zlatanov <tzz@lifelogs.com>
To: emacs-devel@gnu.org
Subject: Re: Testing the gnutls support
Date: Fri, 01 Apr 2011 09:35:59 -0500 [thread overview]
Message-ID: <871v1m6nu8.fsf@lifelogs.com> (raw)
In-Reply-To: m37hbhwtyw.fsf@quimbies.gnus.org
On Tue, 29 Mar 2011 22:29:59 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote:
LMI> Ted Zlatanov <tzz@lifelogs.com> writes:
>> It's probably cleaner to save every invalid certificate in a list and
>> give the user a UI to choose which certificates they wish to accept,
>> perhaps linking to the last validation failure and whatever else will
>> help the user identify which certificates he wants to accept (maybe a
>> hash ID of the certificate in the messages buffer).
LMI> What's the use case here?
LMI> If I'm connecting to imap.gmail.com, I probably do want to be prompted
LMI> with a "invalid certificate" if the certificate is invalid. And
LMI> possibly a "view certificate" before accepting it anyway. Is anything
LMI> more complicated than that necessary?
Normally GnuTLS-using programs, through a callback, do the prompting and
viewing when the invalid certificate is presented. I think, considering
Emacs as an environment, that doing minibuffer prompting during a C
callback from an external library can cause serious problems. So I'd
rather save the invalid certificate in a list at the time it's
presented and fail the connection.
After the connection fails, the code that uses gnutls.el can look at
`gnutls-rejected-certificates' (which will have the certificate and
enough information about the connection to figure out what it's for).
And it can then save some of those certificates and `gnutls-negotiate'
will pick them up.
`gnutls-negotiate' can pick up certificates either implicitly by trying
~/.emacs.d/certs/SERVER[.PORT].pem or explicitly if they are passed in
externally. The GnuTLS maintainers suggested the former approach. I
think it's more manageable long-term as well.
So, from the proto-stream.el perspective, you would try the connection
and if it fails, look at `gnutls-rejected-certificates' for an entry
relevant to the connection you just failed to make. You would then ask
the user "do you want to accept certificate?" and show the info; if they
accept you'd save to ~/.emacs.d/certs/SERVER[.PORT].pem.
To know if you need to save the port in the name you could ask
auth-source for all the entries for SERVER or you could ask the user.
Ted
next prev parent reply other threads:[~2011-04-01 14:35 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-07 21:42 Testing the gnutls support Lars Magne Ingebrigtsen
2010-10-08 13:45 ` Ted Zlatanov
2010-10-09 13:18 ` Lars Magne Ingebrigtsen
2010-10-09 13:37 ` Eli Zaretskii
2010-10-09 13:56 ` Lars Magne Ingebrigtsen
2010-10-10 4:50 ` Ted Zlatanov
2010-10-10 15:26 ` Lars Magne Ingebrigtsen
2010-10-11 14:02 ` Ted Zlatanov
2010-10-11 16:25 ` Lars Magne Ingebrigtsen
2010-10-11 17:25 ` Ted Zlatanov
2010-10-14 21:37 ` Lars Magne Ingebrigtsen
2011-03-28 18:52 ` Ted Zlatanov
2011-03-28 19:08 ` Ted Zlatanov
2011-03-29 20:29 ` Lars Magne Ingebrigtsen
2011-04-01 14:35 ` Ted Zlatanov [this message]
2011-04-01 15:39 ` Lars Magne Ingebrigtsen
2011-04-01 20:11 ` Ted Zlatanov
2011-04-02 20:26 ` Lars Magne 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871v1m6nu8.fsf@lifelogs.com \
--to=tzz@lifelogs.com \
--cc=emacs-devel@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.