Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix build for unit test #3494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 3, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions tests/online/badssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,34 @@
static git_repository *g_repo;

#if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT)
static bool g_has_ssl = true;
#else
static bool g_has_ssl = false;
#endif

void test_online_badssl__expired(void)
{
if (!g_has_ssl)
cl_skip();

cl_git_fail_with(GIT_ECERTIFICATE,
git_clone(&g_repo, "https://expired.badssl.com/fake.git", "./fake", NULL));
}

void test_online_badssl__wrong_host(void)
{
if (!g_has_ssl)
cl_skip();

cl_git_fail_with(GIT_ECERTIFICATE,
git_clone(&g_repo, "https://wrong.host.badssl.com/fake.git", "./fake", NULL));
}

void test_online_badssl__self_signed(void)
{
if (!g_has_ssl)
cl_skip();

cl_git_fail_with(GIT_ECERTIFICATE,
git_clone(&g_repo, "https://self-signed.badssl.com/fake.git", "./fake", NULL));
}

#endif