Skip to content

Commit

Permalink
[PATCH] Support for more CURL SSL settings via environment variables
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Nick Hengeveld authored and Junio C Hamano committed Sep 28, 2005
1 parent 49c188f commit 5acb6de
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions http-fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,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
{
Expand Down Expand Up @@ -522,6 +526,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;
Expand Down

0 comments on commit 5acb6de

Please sign in to comment.