Skip to content

Commit 592a325

Browse files
committed
winhttp: test proxy https clone
1 parent 1bc8dec commit 592a325

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/online/clone.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,28 @@ void test_online_clone__proxy_credentials_in_environment(void)
869869
git_buf_dispose(&url);
870870
}
871871

872+
void test_online_clone__proxy_credentials_in_url_https(void)
873+
{
874+
git_buf url = GIT_BUF_INIT;
875+
876+
if (!_remote_proxy_host || !_remote_proxy_user || !_remote_proxy_pass)
877+
cl_skip();
878+
879+
cl_git_pass(git_buf_printf(&url, "%s://%s:%s@%s/",
880+
_remote_proxy_scheme ? _remote_proxy_scheme : "http",
881+
_remote_proxy_user, _remote_proxy_pass, _remote_proxy_host));
882+
883+
g_options.fetch_opts.proxy_opts.type = GIT_PROXY_SPECIFIED;
884+
g_options.fetch_opts.proxy_opts.url = url.ptr;
885+
g_options.fetch_opts.proxy_opts.certificate_check = proxy_cert_cb;
886+
g_options.fetch_opts.callbacks.certificate_check = ssl_cert;
887+
called_proxy_creds = 0;
888+
cl_git_pass(git_clone(&g_repo, "https://github.com/libgit2/TestGitRepository", "./foo", &g_options));
889+
cl_assert(called_proxy_creds == 0);
890+
891+
git_buf_dispose(&url);
892+
}
893+
872894
void test_online_clone__proxy_auto_not_detected(void)
873895
{
874896
g_options.fetch_opts.proxy_opts.type = GIT_PROXY_AUTO;

0 commit comments

Comments
 (0)