From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: `url-retrieve' for https behind proxy: 400 bad request Date: Tue, 8 Nov 2016 12:58:18 +0100 Message-ID: <20161108115818.GB13267@tuxteam.de> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; x-action=pgp-signed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1478606480 31787 195.159.176.226 (8 Nov 2016 12:01:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 8 Nov 2016 12:01:20 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 08 13:01:10 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4551-0004Ka-6P for geh-help-gnu-emacs@m.gmane.org; Tue, 08 Nov 2016 13:00:43 +0100 Original-Received: from localhost ([::1]:60458 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4554-0005rE-6E for geh-help-gnu-emacs@m.gmane.org; Tue, 08 Nov 2016 07:00:46 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41373) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c452u-0004wl-09 for help-gnu-emacs@gnu.org; Tue, 08 Nov 2016 06:58:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c452q-00039K-Te for help-gnu-emacs@gnu.org; Tue, 08 Nov 2016 06:58:32 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]:46210 helo=tomasium.tuxteam.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c452q-00037Z-O7 for help-gnu-emacs@gnu.org; Tue, 08 Nov 2016 06:58:28 -0500 Original-Received: from tomas by tomasium.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1c452g-0003aa-Td for help-gnu-emacs@gnu.org; Tue, 08 Nov 2016 12:58:18 +0100 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 5.199.139.25 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111684 Archived-At: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tue, Nov 08, 2016 at 09:18:07AM +0300, Andrew Savonichev wrote: > Hi, > > I use GNU/Emacs behind the http proxy with no user authorization, and > seems `url-retrieve' does not work correctly with the proxy-server - > error "400 Bad Request" for any https url. > > Environment variables (http_proxy and https_proxy) are correctly set > and other tools except the emacs work fine: tried curl and wget. > > I've compared url-retrieve and curl requests to the proxy-server > and there is a difference: > curl does CONNECT followed by GET, while url-retrieve use a direct > GET request. > > curl (works fine): > CONNECT www.google.com:443 HTTP/1.1 > Host: www.google.com:443 > User-Agent: curl/7.29.0 > Proxy-Connection: Keep-Alive > > GET / HTTP/1.1 > User-Agent: curl/7.29.0 > Host: www.google.com > Accept: */* > > url-retrieve (error 400): > GET https://www.google.com/ HTTP/1.1 > MIME-Version: 1.0 > Extension: Security/Digest Security/SSL > Host: www.google.com > Accept-encoding: gzip > Accept: */* > User-Agent: URL/Emacs Yeah. This is the usual dance for https over proxy (if the proxy allows it). Basically, CONNECT tells the proxy to just pass the https stream along, untouched. > I've tried it with the GNU/Emacs 25.1 and 24.3.1 releases (with -Q > command line option). Seems url-retrieve hasn't implemented *that* wart yet. Consider reporting a bug (Disclaimer: I haven't tested with latest Emacs). > Is it a bug? Any ideas would be appreciated. I think so (but see disclaimer above). Or perhaps a missing feature. Regards - -- tomás -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlghvdoACgkQBcgs9XrR2ka+wQCfelLpIhZtizQbUNWo/stlF1ld Z+oAnivbrKHDq9OLp+H22DhwgqUKyVbv =kWtF -----END PGP SIGNATURE-----