Skip to content

Commit 39fa791

Browse files
committed
Merge branch 'ls/http-ssl-cipher-list'
Introduce http.<url>.SSLCipherList configuration variable to tweak the list of cipher suite to be used with libcURL when talking with https:// sites. * ls/http-ssl-cipher-list: http: add support for specifying an SSL cipher list
2 parents b54301b + f6f2a9e commit 39fa791

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

Documentation/config.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,6 +1569,19 @@ http.saveCookies::
15691569
If set, store cookies received during requests to the file specified by
15701570
http.cookieFile. Has no effect if http.cookieFile is unset.
15711571

1572+
http.sslCipherList::
1573+
A list of SSL ciphers to use when negotiating an SSL connection.
1574+
The available ciphers depend on whether libcurl was built against
1575+
NSS or OpenSSL and the particular configuration of the crypto
1576+
library in use. Internally this sets the 'CURLOPT_SSL_CIPHER_LIST'
1577+
option; see the libcurl documentation for more details on the format
1578+
of this list.
1579+
+
1580+
Can be overridden by the 'GIT_SSL_CIPHER_LIST' environment variable.
1581+
To force git to use libcurl's default cipher list and ignore any
1582+
explicit http.sslCipherList option, set 'GIT_SSL_CIPHER_LIST' to the
1583+
empty string.
1584+
15721585
http.sslVerify::
15731586
Whether to verify the SSL certificate when fetching or pushing
15741587
over HTTPS. Can be overridden by the 'GIT_SSL_NO_VERIFY' environment

contrib/completion/git-completion.bash

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2122,6 +2122,7 @@ _git_config ()
21222122
http.noEPSV
21232123
http.postBuffer
21242124
http.proxy
2125+
http.sslCipherList
21252126
http.sslCAInfo
21262127
http.sslCAPath
21272128
http.sslCert

http.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ char curl_errorstr[CURL_ERROR_SIZE];
3636
static int curl_ssl_verify = -1;
3737
static int curl_ssl_try;
3838
static const char *ssl_cert;
39+
static const char *ssl_cipherlist;
3940
#if LIBCURL_VERSION_NUM >= 0x070903
4041
static const char *ssl_key;
4142
#endif
@@ -187,6 +188,8 @@ static int http_options(const char *var, const char *value, void *cb)
187188
curl_ssl_verify = git_config_bool(var, value);
188189
return 0;
189190
}
191+
if (!strcmp("http.sslcipherlist", var))
192+
return git_config_string(&ssl_cipherlist, var, value);
190193
if (!strcmp("http.sslcert", var))
191194
return git_config_string(&ssl_cert, var, value);
192195
#if LIBCURL_VERSION_NUM >= 0x070903
@@ -361,6 +364,13 @@ static CURL *get_curl_handle(void)
361364
if (http_proactive_auth)
362365
init_curl_http_auth(result);
363366

367+
if (getenv("GIT_SSL_CIPHER_LIST"))
368+
ssl_cipherlist = getenv("GIT_SSL_CIPHER_LIST");
369+
370+
if (ssl_cipherlist != NULL && *ssl_cipherlist)
371+
curl_easy_setopt(result, CURLOPT_SSL_CIPHER_LIST,
372+
ssl_cipherlist);
373+
364374
if (ssl_cert != NULL)
365375
curl_easy_setopt(result, CURLOPT_SSLCERT, ssl_cert);
366376
if (has_cert_password())

0 commit comments

Comments
 (0)