git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Hengeveld <nickh@reactrix.com>
To: git@vger.kernel.org
Subject: [PATCH] Support for more CURL SSL settings via environment variables
Date: Tue, 27 Sep 2005 10:45:27 -0700	[thread overview]
Message-ID: <20050927174526.GD1377@reactrix.com> (raw)

Added support for additional CURL SSL settings via environment variables.
Client certificate/key files can be specified as well as alternate CA
information.

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>


---

 http-fetch.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

8ce3710b0b838d6f4c9813ad3631afced80ce346
diff --git a/http-fetch.c b/http-fetch.c
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -35,6 +35,10 @@ static int local;
 static int zret;
 
 static int curl_ssl_verify;
+static char *ssl_cert;
+static char *ssl_key;
+static char *ssl_capath;
+static char *ssl_cainfo;
 
 struct buffer
 {
@@ -512,6 +516,21 @@ int main(int argc, char **argv)
 	curl_easy_setopt(curl, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);
 #endif
 
+	if ((ssl_cert = getenv("GIT_SSL_CERT")) != NULL) {
+		curl_easy_setopt(curl, CURLOPT_SSLCERT, ssl_cert);
+	}
+	if ((ssl_key = getenv("GIT_SSL_KEY")) != NULL) {
+		curl_easy_setopt(curl, CURLOPT_SSLKEY, ssl_key);
+	}
+#if LIBCURL_VERSION_NUM >= 0x070908
+	if ((ssl_capath = getenv("GIT_SSL_CAPATH")) != NULL) {
+		curl_easy_setopt(curl, CURLOPT_CAPATH, ssl_capath);
+	}
+#endif
+	if ((ssl_cainfo = getenv("GIT_SSL_CAINFO")) != NULL) {
+		curl_easy_setopt(curl, CURLOPT_CAINFO, ssl_cainfo);
+	}
+
 	alt = xmalloc(sizeof(*alt));
 	alt->base = url;
 	alt->got_indices = 0;

                 reply	other threads:[~2005-09-27 17:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20050927174526.GD1377@reactrix.com \
    --to=nickh@reactrix.com \
    --cc=git@vger.kernel.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).