From 29e7ae5d81c1615fbcde78d7fbf44856059d9b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Mon, 16 Mar 2015 19:39:05 +0100 Subject: [PATCH] Add failing test for cert callback with non-ecrypted stream When we have an HTTP stream and have set the certificatre check callback, we currently fail as we ask the unencrypted stream for its certificate. --- tests/online/clone.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/online/clone.c b/tests/online/clone.c index 3bb927955..4fdeee1d2 100644 --- a/tests/online/clone.c +++ b/tests/online/clone.c @@ -565,3 +565,10 @@ void test_online_clone__certificate_valid(void) cl_git_pass(git_clone(&g_repo, "https://github.com/libgit2/TestGitRepository", "./foo", &g_options)); } + +void test_online_clone__start_with_http(void) +{ + g_options.remote_callbacks.certificate_check = succeed_certificate_check; + + cl_git_pass(git_clone(&g_repo, "http://github.com/libgit2/TestGitRepository", "./foo", &g_options)); +}