From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: url library and GnuTLS, and Emacs-issued certificates Date: Thu, 24 Mar 2011 20:45:26 +0100 Organization: Programmerer Ingebrigtsen Message-ID: References: <87mxkojpk4.fsf@lifelogs.com> <87hbawtbq7.fsf@stupidchicken.com> <878vw8hznm.fsf_-_@lifelogs.com> <87ei5xsvl6.fsf@lifelogs.com> <87hbatofix.fsf@stupidchicken.com> <87ei5xo695.fsf@stupidchicken.com> <87pqpgpdgq.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1300995960 27385 80.91.229.12 (24 Mar 2011 19:46:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 24 Mar 2011 19:46:00 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 24 20:45:50 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q2qTd-00059K-6j for ged-emacs-devel@m.gmane.org; Thu, 24 Mar 2011 20:45:49 +0100 Original-Received: from localhost ([127.0.0.1]:57183 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2qTc-0008IX-OJ for ged-emacs-devel@m.gmane.org; Thu, 24 Mar 2011 15:45:48 -0400 Original-Received: from [140.186.70.92] (port=43525 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2qTW-0008Dp-NB for emacs-devel@gnu.org; Thu, 24 Mar 2011 15:45:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q2qTT-0003qK-Aq for emacs-devel@gnu.org; Thu, 24 Mar 2011 15:45:42 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:38413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q2qTS-0003q6-Tu for emacs-devel@gnu.org; Thu, 24 Mar 2011 15:45:39 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Q2qTS-000539-06 for emacs-devel@gnu.org; Thu, 24 Mar 2011 20:45:38 +0100 Original-Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 Mar 2011 20:45:37 +0100 Original-Received: from larsi by cm-84.215.51.58.getinternet.no with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 Mar 2011 20:45:37 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 42 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cm-84.215.51.58.getinternet.no Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAHlBMVEXr4d4hHR737Onz6OXD ubzc0tSTiYm7sLPx5ePMwsW6d0oIAAACKklEQVQ4jXXSMYvbMBQHcAWaq8dqOGUNMrQZg0VL1gOT kC2FCyFbzDVyujXgs/AmLm3ReuD00Le9957kOASqQIb38/+9J2P2vGLXZ7herfFs2S/GbiQc9hwL SS9kbNcVEvc/sIyBDVfDG8AlLFvFQAfwqIYy+3h/Gb6jwZYlxb1lw+ITVf2ZABZKEvfAE3bHd1T3 /hxaWevsAIqvfB/BA1joA4kBb/ScYBsSiXVwB+cGe85Hr/tQxwQUmTud3PQv5/ynj522CIk7qZmT BcCo9eGsKeGUchmBADj7OOM0UwgTjpA3IQHgoBH85BcEbq5AOQAlPxOU1dLHrWAjeD7rwORB2AEm zzKZpVfQUgLaKCllhNEFDnAHJYG+RaiqHLshnDICrWtdXAEGEAYd5HAIFAQyOQEoRCEW1VuAJyjK DOC7KDiAqdoIUFcI8DgM1ya/gEoxNC64RoBan0glgdCYaLZxq0ymeMHxke4hzLJpO8BOchoA3olZ xnUD2IcAusQrLgNIhLoHQ5AFYPMAAhYOIFPsJD/UUMO1dBlB0YjJnYaaxj8YH1pRp8mmFmVlNK9r HYECcvxYC5MvTGF6SAkWAFVuitLcJPJawAeSH3vIELJxOxeV9+1Rm274C8HU/wPYAsBWed/q5ev6 jRu/bo/iAtRK/mEbXi47iG+XYPrIdQMAL4s+E/YkaYadbrhofFuLDg74HaaZZW9c/PALfTUcpqfy 9x7ebrmsL/AOK90/qfg6iZ8AAAAASUVORK5CYII= Mail-Copies-To: never X-Now-Playing: David Sylvian's _Sleepwalkers_: "Trauma" User-Agent: Gnus/5.110016 (No Gnus v0.16) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:7T8U7nqXRWiirDcfyUOJULsuuO4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:137652 Archived-At: Chong Yidong writes: > How about gnutls.el? If I understand correctly, open-gnutls-stream > works just like open-tls-stream, except it uses the gnutls library > directly instead of using a command line client---and it does not > support the mode of operation provided in starttls.el. Correct? No, with gnutls.c, we just open a normal network stream (with `open-network-stream'), and then if it turns out that the server supports STARTTLS, we just put the server in STARTTLS mode and then issue a `gnutls-negotiate' call. > Also, does this mean it's impossible to use open-tls-stream and > open-gnutls-stream to opportunistically open a TLS stream? I see that > proto-stream.el, in `network' mode, opens a connection using > starttls-open-stream and then uses gnutls-negotiate from gnutls.el to do > the negotiation; what's the advantage of doing this? Looking at the code in `proto-stream-open-network', I can see why you think it's doing that, but it's not. I hope. :-) That function is somewhat hairy because of all the combinations in the do-opportunistic-upgrade/do-forced-upgrade/starttls.el/gnutls.c/do-support-STARTTLS matrix, as well as error handling... But for the "gnutls where the server supports STARTTLS and there's no errors" case, it should just be doing (defun proto-stream-open-network (name buffer host service parameters) [...] (stream (open-network-stream name buffer host service)) [...] ;; The server said it was OK to start doing STARTTLS negotiations. (if (fboundp 'open-gnutls-stream) (gnutls-negotiate stream nil) -- (domestic pets only, the antidote for overdose, milk.) larsi@gnus.org * Lars Magne Ingebrigtsen