summaryrefslogtreecommitdiff
path: root/src/remote.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-07-04 12:45:43 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-09-16 17:01:30 +0200
commit9b9405865e15da3a0a6ee0a67b59b36c5a973a8c (patch)
treeab758a8c8b5ff4ecb6d5e2d91926c0ca397d56f8 /src/remote.c
parentd99c8ca1783cfd04869e88f8707c036fc6053a05 (diff)
downloadlibgit2-9b9405865e15da3a0a6ee0a67b59b36c5a973a8c.tar.gz
Provide a callback for certificate validation
If the certificate validation fails (or always in the case of ssh), let the user decide whether to allow the connection. The data structure passed to the user is the native certificate information from the underlying implementation, namely OpenSSL or WinHTTP.
Diffstat (limited to 'src/remote.c')
-rw-r--r--src/remote.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/remote.c b/src/remote.c
index 433015f60..9c93f67a1 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -673,7 +673,7 @@ int git_remote_connect(git_remote *remote, git_direction direction)
return error;
if (t->set_callbacks &&
- (error = t->set_callbacks(t, remote->callbacks.sideband_progress, NULL, remote->callbacks.payload)) < 0)
+ (error = t->set_callbacks(t, remote->callbacks.sideband_progress, NULL, remote->callbacks.certificate_check, remote->callbacks.payload)) < 0)
goto on_error;
if (!remote->check_cert)
@@ -1263,6 +1263,7 @@ int git_remote_set_callbacks(git_remote *remote, const git_remote_callbacks *cal
return remote->transport->set_callbacks(remote->transport,
remote->callbacks.sideband_progress,
NULL,
+ remote->callbacks.certificate_check,
remote->callbacks.payload);
return 0;