你好,问题是,当我使用libgit2来克隆一个repo时,它会导致:"无法发送请求:发生了一个安全错误",代码为:
#include <windows.h>
#include "include/git2.h"
#pragma comment(lib, "git2.lib")
int main(int argc, char* argv[])
{
git_threads_init();
git_repository* repo = NULL;
git_clone_options opts = GIT_CLONE_OPTIONS_INIT;
int iRetVal;
opts.bare = true;
iRetVal = git_clone(&repo, "https://github.com/libgit2/libgit2.git", "C:\\test", &opts);
if( (iRetVal < 0) && (giterr_last() != NULL) )
{
MessageBox(NULL, giterr_last()->message, "gittest", MB_ICONERROR | MB_OK);
}
if( repo != NULL )
git_repository_free(repo);
git_threads_shutdown();
return 0;
}
libgit2版本为0.21.2