git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Lodato <lodatom@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/2] http.c: prompt for SSL client certificate password
Date: Fri, 12 Jun 2009 20:33:23 -0400	[thread overview]
Message-ID: <ca433830906121733w7c88dfd4w1025b7b936e48e95@mail.gmail.com> (raw)
In-Reply-To: <7vocst3s8n.fsf@alter.siamese.dyndns.org>

On Fri, Jun 12, 2009 at 8:14 PM, Junio C Hamano<gitster@pobox.com> wrote:
> Mark Lodato <lodatom@gmail.com> writes:
>
>> If this patch series is accepted, I
>> will make a cleaner version that includes this change.
>
> Sorry, but I do not understand this part of your message.
>

Sorry about that.  I meant that I have cleaned up the code as you
suggested (see diff below), and that if you decide to include the
patch series into git.git (I see now you included it in pu), I can
either submit an additional patch to perform the cleanup, or submit a
new "v2" patch series incorporating these changes.  Is one preferred
over the other?

Also, I wasn't sure where to put the #defines; I chose to put them in
http.h, but should they go in http.c?

Thanks for the feedback!
Mark


diff --git c/http.c i/http.c
index 6ae59b6..7659ef4 100644
--- c/http.c
+++ i/http.c
@@ -213,16 +213,8 @@ static CURL *get_curl_handle(void)
        if (ssl_cert != NULL)
                curl_easy_setopt(result, CURLOPT_SSLCERT, ssl_cert);
        if (has_cert_password())
-               curl_easy_setopt(result,
-#if LIBCURL_VERSION_NUM >= 0x071700
-                                CURLOPT_KEYPASSWD,
-#elif LIBCURL_VERSION_NUM >= 0x070903
-                                CURLOPT_SSLKEYPASSWD,
-#else
-                                CURLOPT_SSLCERTPASSWD,
-#endif
-                                ssl_cert_password);
-#if LIBCURL_VERSION_NUM >= 0x070902
+               curl_easy_setopt(result, CURLOPT_KEYPASSWD, ssl_cert_password);
+#ifndef NO_CURLOPT_SSLKEY
        if (ssl_key != NULL)
                curl_easy_setopt(result, CURLOPT_SSLKEY, ssl_key);
 #endif
diff --git c/http.h i/http.h
index 26abebe..b49c280 100644
--- c/http.h
+++ i/http.h
@@ -29,6 +29,12 @@
 #define curl_global_init(a) do { /* nothing */ } while(0)
 #endif

+#if LIBCURL_VERSION_NUM < 0x070903
+#define CURLOPT_KEYPASSWD CURLOPT_SSLCERTPASSWD
+#elif LIBCURL_VERSION_NUM < 0x071700
+#define CURLOPT_KEYPASSWD CURLOPT_SSLKEYPASSWD
+#endif
+
 #if (LIBCURL_VERSION_NUM < 0x070c04) || (LIBCURL_VERSION_NUM == 0x071000)
 #define NO_CURL_EASY_DUPHANDLE
 #endif

  reply	other threads:[~2009-06-13  0:33 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-28  3:16 [PATCH 1/2] http.c: prompt for SSL client certificate password Mark Lodato
2009-05-28  3:16 ` [PATCH 2/2] http.c: add http.sslCertNoPass option Mark Lodato
2009-06-05  2:44 ` [PATCH 1/2] http.c: prompt for SSL client certificate password Mark Lodato
2009-06-05  8:20   ` Constantine Plotnikov
2009-06-07 14:10     ` Mark Lodato
2009-06-11 23:00 ` Mark Lodato
2009-06-11 23:42   ` Nanako Shiraishi
2009-06-11 23:59     ` Junio C Hamano
2009-06-12  7:56     ` Daniel Stenberg
2009-06-12 15:38       ` Constantine Plotnikov
2009-06-12 16:50         ` Jakub Narebski
2009-06-12 21:49           ` Rogan Dawes
2009-06-12 23:11           ` Mark Lodato
2009-06-12 23:26       ` Mark Lodato
2009-06-13  0:31         ` Junio C Hamano
2009-06-13  0:49           ` Mark Lodato
2009-06-13 11:22           ` Daniel Stenberg
2009-06-11 23:56   ` Junio C Hamano
2009-06-12 22:31     ` Mark Lodato
2009-06-12  6:34 ` Junio C Hamano
2009-06-12  7:59   ` Daniel Stenberg
2009-06-12 23:13   ` Mark Lodato
2009-06-13  0:14     ` Junio C Hamano
2009-06-13  0:33       ` Mark Lodato [this message]
2009-06-13  1:12         ` Junio C Hamano

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=ca433830906121733w7c88dfd4w1025b7b936e48e95@mail.gmail.com \
    --to=lodatom@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).