mirror of
https://github.com/git/git.git
synced 2026-01-24 17:41:30 +00:00
Merge branch 'http-ssl-backend'
This topic branch brings support for choosing cURL's SSL backend at runtime via http.sslBackend, based on patches already submitted to the cURL project and backported to cURL 7.54.1 as used in Git for Windows' SDK. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -1969,6 +1969,11 @@ http.sslCAPath::
|
||||
with when fetching or pushing over HTTPS. Can be overridden
|
||||
by the `GIT_SSL_CAPATH` environment variable.
|
||||
|
||||
http.sslBackend::
|
||||
Name of the SSL backend to use (e.g. "openssl" or "schannel").
|
||||
This option is ignored if cURL lacks support for choosing the SSL
|
||||
backend at runtime.
|
||||
|
||||
http.pinnedpubkey::
|
||||
Public key of the https service. It may either be the filename of
|
||||
a PEM or DER encoded public key file or a string starting with
|
||||
|
||||
23
http.c
23
http.c
@@ -291,6 +291,29 @@ static int http_options(const char *var, const char *value, void *cb)
|
||||
curl_ssl_try = git_config_bool(var, value);
|
||||
return 0;
|
||||
}
|
||||
#if LIBCURL_VERSION_NUM >= 0x073800 || \
|
||||
defined(CURL_WITH_EXPERIMENTAL_SSL_BACKEND_SUPPORT)
|
||||
if (!strcmp("http.sslbackend", var)) {
|
||||
const curl_ssl_backend **backends;
|
||||
struct strbuf buf = STRBUF_INIT;
|
||||
int i;
|
||||
|
||||
switch (curl_global_sslset(-1, value, &backends)) {
|
||||
case CURLSSLSET_UNKNOWN_BACKEND:
|
||||
strbuf_addf(&buf, _("Unsupported SSL backend '%s'. "
|
||||
"Supported SSL backends:"), value);
|
||||
for (i = 0; backends[i]; i++)
|
||||
strbuf_addf(&buf, "\n\t%s", backends[i]->name);
|
||||
die(buf.buf);
|
||||
case CURLSSLSET_TOO_LATE:
|
||||
die(_("Could not set SSL backend to '%s': already set"),
|
||||
value);
|
||||
case CURLSSLSET_OK:
|
||||
break; /* Okay! */
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!strcmp("http.minsessions", var)) {
|
||||
min_curl_sessions = git_config_int(var, value);
|
||||
#ifndef USE_CURL_MULTI
|
||||
|
||||
Reference in New Issue
Block a user