diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2021-03-10 11:19:14 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-10 11:19:14 +0000 |
| commit | a0fca809aca16f080b2e7446b2bcba37c52fe27e (patch) | |
| tree | a3c36930ac6045eff3410deb38f50a7ebea9fd6e /tests | |
| parent | 752dbecf9b0969145ed13dee11cf64fd515ef3c8 (diff) | |
| parent | edffea1548d87cdb1c684792195166e7a1b36a4a (diff) | |
| download | libgit2-a0fca809aca16f080b2e7446b2bcba37c52fe27e.tar.gz | |
Merge pull request #5814 from ianhattendorf/fix/winhttp-proxy-https
winhttp: skip certificate check if unable to send request
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/online/clone.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/online/clone.c b/tests/online/clone.c index c62baac2d..6de687b35 100644 --- a/tests/online/clone.c +++ b/tests/online/clone.c @@ -869,6 +869,28 @@ void test_online_clone__proxy_credentials_in_environment(void) git_buf_dispose(&url); } +void test_online_clone__proxy_credentials_in_url_https(void) +{ + git_buf url = GIT_BUF_INIT; + + if (!_remote_proxy_host || !_remote_proxy_user || !_remote_proxy_pass) + cl_skip(); + + cl_git_pass(git_buf_printf(&url, "%s://%s:%s@%s/", + _remote_proxy_scheme ? _remote_proxy_scheme : "http", + _remote_proxy_user, _remote_proxy_pass, _remote_proxy_host)); + + g_options.fetch_opts.proxy_opts.type = GIT_PROXY_SPECIFIED; + g_options.fetch_opts.proxy_opts.url = url.ptr; + g_options.fetch_opts.proxy_opts.certificate_check = proxy_cert_cb; + g_options.fetch_opts.callbacks.certificate_check = ssl_cert; + called_proxy_creds = 0; + cl_git_pass(git_clone(&g_repo, "https://github.com/libgit2/TestGitRepository", "./foo", &g_options)); + cl_assert(called_proxy_creds == 0); + + git_buf_dispose(&url); +} + void test_online_clone__proxy_auto_not_detected(void) { g_options.fetch_opts.proxy_opts.type = GIT_PROXY_AUTO; |
