git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Hommey <mh@glandium.org>
To: Jeff King <peff@peff.net>
Cc: Anand Kumria <wildfire@progsoc.org>, git@vger.kernel.org
Subject: Re: git-fetch in 1.5.4 fails versus 1.5.3.8
Date: Fri, 8 Feb 2008 08:34:56 +0100	[thread overview]
Message-ID: <20080208073456.GA17791@glandium.org> (raw)
In-Reply-To: <20080208071835.GA11807@glandium.org>

On Fri, Feb 08, 2008 at 08:18:35AM +0100, Mike Hommey wrote:
> On Thu, Feb 07, 2008 at 07:32:39PM -0500, Jeff King wrote:
> > On Thu, Feb 07, 2008 at 11:02:43PM +0100, Mike Hommey wrote:
> > 
> > > Sorry, I've had trouble opening my eyes and actually reading messages I
> > > reply to... anyways, I tried to reproduce with curl-gnutls and...
> > > couldn't... How did you manage that ? Is the server you were trying on
> > > public ? Do you have any http.ssl* variables set in your configuration ?
> > 
> > No, my test repo is not public. I have no special ssl configuration
> > (though I do use GIT_SSL_NO_VERIFY=1 since I just had a test self-signed
> > cert). The exact recipe on my Debian system is:
> > 
> (...)
> 
> Okay, I've been able to reproduce the problem. I don't know what I've
> been doing wrong to have it hidden...
> 
> Anyways, the interesting thing is to look at what curl has to say in its
> verbose mode:
(...)
> 
> So, it looks like either gnutls or curl is doing something wrong and
> can't parse /etc/ssl/certs/ca-certificates.crt a second time. This
> looks like a bug in either curl or gnutls.
> 
> A simplified testcase would probably be to do two requests in a row, but
> I don't have time right now to do this testing.

I'm making myself a liar, but I took some few more minutes to test
something like:
diff --git a/http.c b/http.c
index d2c11ae..001b1c4 100644
--- a/http.c
+++ b/http.c
@@ -186,7 +186,7 @@ static CURL* get_curl_handle(void)
        if (ssl_capath != NULL)
                curl_easy_setopt(result, CURLOPT_CAPATH, ssl_capath);
 #endif
-       if (ssl_cainfo != NULL)
+//     if (ssl_cainfo != NULL)
                curl_easy_setopt(result, CURLOPT_CAINFO, ssl_cainfo);
        curl_easy_setopt(result, CURLOPT_FAILONERROR, 1);
 


And the result is interesting:
GIT_CURL_VERBOSE=1 git fetch
* Couldn't find host localhost in the .netrc file, using defaults
* About to connect() to localhost port 8443 (#0)
*   Trying 127.0.0.1... * connected
* Connected to localhost (127.0.0.1) port 8443 (#0)
*        server certificate verification FAILED
*        common name: localhost (matched)
*        server certificate expiration date OK
*        server certificate activation date OK
*        certificate public key: RSA
*        certificate version: #1
*        subject: C=GB,ST=Some-State,L=Some-Locality,O=One Organization,OU=One Organization Unit,CN=localhost,EMAIL=webmaster@localhost
*        start date: Thu, 07 Feb 2008 21:27:36 GMT
*        expire date: Sat, 08 Mar 2008 21:27:36 GMT
*        issuer: C=GB,ST=Some-State,L=Some-Locality,O=One Organization,OU=One Organization Unit,CN=localhost,EMAIL=webmaster@localhost
*        compression: DEFLATE
*        cipher: AES 256 CBC
*        MAC: SHA
> GET /foo/.git//info/refs HTTP/1.1
User-Agent: git/1.5.4.7.gd8534-dirty
Host: localhost:8443
Accept: */*

< HTTP/1.1 200 OK
< Date: Fri, 08 Feb 2008 07:30:10 GMT
< Server: Apache/2.2.8 (Debian) DAV/2 mod_ssl/2.2.8 OpenSSL/0.9.8g
< Last-Modified: Fri, 08 Feb 2008 06:52:19 GMT
< ETag: "61d82e-3b-445a0080d0ec0"
< Accept-Ranges: bytes
< Content-Length: 59
< Content-Type: text/plain
< 
* Connection #0 to host localhost left intact
* Couldn't find host localhost in the .netrc file, using defaults
* About to connect() to localhost port 8443 (#0)
*   Trying 127.0.0.1... * connected
* Connected to localhost (127.0.0.1) port 8443 (#0)
* gnutls_handshake() failed: ASN1 parser: Element was not found.
* Expire cleared
* Closing connection #0
error: gnutls_handshake() failed: ASN1 parser: Element was not found. (curl_result = 35, http_code = 0, sha1 = e0aa43ffb1a1e7052a936b9ed5e0a1462cfc343e)

So, it looks like either gnutls has a problem reinitializing its ASN1
parser or curl is doing something wrong with gnutls when initializing a
new request.

Mike

  reply	other threads:[~2008-02-08  7:35 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-04 18:25 git-fetch in 1.5.4 fails versus 1.5.3.8 Anand Kumria
2008-02-05  5:07 ` Jeff King
2008-02-05 15:01   ` Jari Aalto
2008-02-06 21:56   ` Anand Kumria
2008-02-07  4:23     ` Jeff King
2008-02-07  6:37       ` Mike Hommey
2008-02-07 10:15       ` Anand Kumria
2008-02-07 11:06         ` Jeff King
2008-02-07 12:10           ` Mike Hommey
2008-02-07 12:28             ` Jeff King
2008-02-07 22:02               ` Mike Hommey
2008-02-08  0:32                 ` Jeff King
2008-02-08  7:18                   ` Mike Hommey
2008-02-08  7:34                     ` Mike Hommey [this message]
2008-02-08 20:08                       ` [PATCH] Work around curl-gnutls not liking to be reinitialized Mike Hommey
2008-02-08 21:31                         ` Mike Hommey
2008-02-08 21:46                           ` Junio C Hamano
2008-02-08 21:51                             ` Mike Hommey
2008-02-08 22:09                               ` Mike Hommey
2008-02-08 22:22                                 ` [PATCH v2] " Mike Hommey
2008-02-08 22:51                                   ` Johannes Schindelin
2008-02-08 23:08                                     ` [PATCH] " Mike Hommey
2008-02-08 23:14                                       ` Mike Hommey
2008-02-09  9:41                                       ` [PATCH v4] " Mike Hommey
2008-02-09 21:51                                         ` Daniel Stenberg
2008-02-09  9:44                                   ` [PATCH v2] " Florian Weimer
2008-02-09 10:43                                     ` Mike Hommey
2008-02-08 21:53                           ` [PATCH] " Johannes Schindelin
2008-02-08 22:01                             ` Mike Hommey
2008-02-09  2:28                         ` Jeff King
2008-02-07 14:23         ` git-fetch in 1.5.4 fails versus 1.5.3.8 Frank Lichtenheld
2008-02-07 18:42           ` Linus Torvalds
2008-02-07 20:14             ` Frank Lichtenheld
2008-02-07 20:54               ` Linus Torvalds
2008-02-07 21:36                 ` Anand Kumria
2008-02-07 20:40             ` Jeff King
2008-02-07 21:01               ` Linus Torvalds
2008-02-07 21:47                 ` Martin Langhoff
2008-02-07 21:53                 ` Dmitry Potapov
2008-02-07 22:46                   ` Jeff King
2008-02-07 22:40                 ` Jeff King
2008-02-07 23:23         ` Dmitry Potapov
2008-02-08  2:43           ` Anand Kumria
2008-02-08 13:27             ` Dmitry Potapov

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=20080208073456.GA17791@glandium.org \
    --to=mh@glandium.org \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=wildfire@progsoc.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.
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 NNTP newsgroup(s).