diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2023-03-06 15:19:29 -0800 |
---|---|---|
committer | Edward Thomson <ethomson@vercel.com> | 2023-03-21 09:09:48 +0000 |
commit | f68f542eb63efb0f50e00d2376196f5bd48ed41e (patch) | |
tree | b027843970124cb02cf2f36a7aa663b311fc76cc /tests/libgit2/online | |
parent | 1b929b3d8531dbf6326285491e2e17ff4db2c337 (diff) | |
download | libgit2-f68f542eb63efb0f50e00d2376196f5bd48ed41e.tar.gz |
http: introduce schannel streams for windows
Provide a stream interface for Schannel - the native crypto APIs - on
Windows. This allows Windows to use the same HTTP transport that all the
other platforms use, with its own native crypto.
Ultimately this allows us to deprecate WinHTTP and we need not add
support for our socket changes in two places (our HTTP stack and the
WinHTTP stack).
Diffstat (limited to 'tests/libgit2/online')
-rw-r--r-- | tests/libgit2/online/clone.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/libgit2/online/clone.c b/tests/libgit2/online/clone.c index 1a4cdb520..b635739b6 100644 --- a/tests/libgit2/online/clone.c +++ b/tests/libgit2/online/clone.c @@ -580,6 +580,17 @@ static int succeed_certificate_check(git_cert *cert, int valid, const char *host return 0; } +static int x509_succeed_certificate_check(git_cert *cert, int valid, const char *host, void *payload) +{ + GIT_UNUSED(valid); + GIT_UNUSED(payload); + + cl_assert_equal_s("github.com", host); + cl_assert_equal_i(GIT_CERT_X509, cert->cert_type); + + return 0; +} + static int fail_certificate_check(git_cert *cert, int valid, const char *host, void *payload) { GIT_UNUSED(cert); @@ -901,7 +912,7 @@ void test_online_clone__certificate_invalid(void) void test_online_clone__certificate_valid(void) { - g_options.fetch_opts.callbacks.certificate_check = succeed_certificate_check; + g_options.fetch_opts.callbacks.certificate_check = x509_succeed_certificate_check; cl_git_pass(git_clone(&g_repo, "https://github.com/libgit2/TestGitRepository", "./foo", &g_options)); } |