From: Jeff King <peff@peff.net>
To: Jerry Qassar <jqassar@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] http.c: Add config options/parsing for SSL engine vars
Date: Tue, 30 Apr 2013 16:22:42 -0400 [thread overview]
Message-ID: <20130430202242.GA3247@sigill.intra.peff.net> (raw)
In-Reply-To: <CAJC3a=pU2m8LpUh0u0XXXgOiDiPo-QAdA471orGs9jcyDJTU5g@mail.gmail.com>
On Tue, Apr 30, 2013 at 01:04:17PM -0700, Jerry Qassar wrote:
> First, thanks very much for taking a look at this. I wasn't 100% certain about
> the versioning to use for it (specifically the version-to-0x mapping), so any
> input on that would be a big help. I'll try to answer your questions below...
The explanation is hiding in a comment in curlver.h:
This is the numeric version of the libcurl version number, meant for
easier parsing and comparions by programs. The LIBCURL_VERSION_NUM
define will always follow this syntax:
0xXXYYZZ
Where XX, YY and ZZ are the main version, release and patch numbers in
hexadecimal (using 8 bits each). All three numbers are always
represented using two digits. 1.2 would appear as "0x010200" while
version 9.11.7 appears as "0x090b07".
So I think you'd just want to check:
#if LIBCURL_VERSION_NUM >= 0x070903
It looks like we already have such an #if block for ssl_key, so you
could just add the new options there.
> > Current curl seems to take ENG only for the key, and assumes you have
> > the certificate on disk [...]
> [...]
> Curl already does support engine-based certificates (in code and
> help).
My "seems to..." above was based on reading the curl_easy_setopt
manpage. It sounds like that documentation may be out of date.
> I can't think of a way to reliably provide a hardware-dependent engine
> implementation to the suite. So ENG is probably out, but I can think
> of something to verify PEM and DER once I figure out how the test
> suite works.
I think the trickiest part for testing PEM/DER support will actually be
setting up the apache config to authenticate a user based on a client
side certificate. I was hoping you might know off-hand since that is
obviously the goal of your patch (though of course you might not be
using apache). The relevant config would be in t/lib-httpd/apache.conf,
and the tests could probably go into t/t5551-http-fetch.sh.
> > Shouldn't we be checking the result of curl_easy_setopt for errors here
> > (and when the engine cannot be loaded)? I think we should probably die
> > if the engine can't be loaded, but at the very least we'd want to warn
> > the user that their settings are being ignored.
>
> Errors are handled by curl (up to this point):
>
> 1) Setting the cert type to FOO:
> error: not supported file type 'FOO' for certificate...
> fatal: HTTP request failed
>
> 2) Setting the key type to FOO:
> error: not supported file type for private key...
> fatal: HTTP request failed
>
> 3) Setting engine type to something invalid:
> * SSL Engine 'pkcsfoo' not found (only with GIT_CURL_VERBOSE set)
> error: crypto engine not set, can't load certificate...
> fatal: HTTP request failed
>
> ...that last one could probably be a little better, but it's curl-managed.
Hmm. So all of that happens when we actually try to make the request. I
think that should be OK. Curl is presumably smart enough to fail early
in the *_perform() functions, when it notices the handle is in a bogus
state.
> Thanks very much for the constructive input. Once I make the
> corrections and determine how to make some appropriate tests I'll
> resubmit. I guess my open question is, if you wish to wrap the prop
> setting in a curl version #if, what version is desired?
>From my reading of the curl docs, it's 7.9.3.
-Peff
prev parent reply other threads:[~2013-04-30 20:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-23 23:03 [PATCH] http.c: Add config options/parsing for SSL engine vars Jerry Qassar
2013-04-30 16:45 ` Junio C Hamano
2013-04-30 18:27 ` Jeff King
2013-04-30 20:04 ` Jerry Qassar
2013-04-30 20:17 ` Junio C Hamano
2013-04-30 20:29 ` Jeff King
2013-04-30 21:05 ` Jerry Qassar
2013-04-30 20:22 ` Jeff King [this message]
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=20130430202242.GA3247@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jqassar@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.
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).