diff options
author | Nick Hengeveld <nickh@reactrix.com> | 2005-09-27 10:45:27 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-09-28 16:38:51 -0700 |
commit | 5acb6de13d7af33abcfcbdc885ec365e6a51c486 (patch) | |
tree | 4fc601b081fb4ba8a0c21ded5a633373d1ffe0b5 /http-fetch.c | |
parent | 49c188fa8ff599cb6863eb5d86bfdbe22f2b8496 (diff) | |
download | git-5acb6de13d7af33abcfcbdc885ec365e6a51c486.tar.gz |
[PATCH] Support for more CURL SSL settings via environment variables
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>
Diffstat (limited to 'http-fetch.c')
-rw-r--r-- | http-fetch.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/http-fetch.c b/http-fetch.c index 0caec10468..7fc363f8ea 100644 --- a/http-fetch.c +++ b/http-fetch.c @@ -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 { @@ -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; |