MCPcopy Create free account
hub / github.com/libgit2/git2go / TestCertificateCheck

Function TestCertificateCheck

remote_test.go:50–69  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

48}
49
50func TestCertificateCheck(t *testing.T) {
51 t.Parallel()
52 repo := createTestRepo(t)
53 defer cleanupTestRepo(t, repo)
54
55 remote, err := repo.Remotes.Create("origin", "https://github.com/libgit2/TestGitRepository")
56 checkFatal(t, err)
57 defer remote.Free()
58
59 options := FetchOptions{
60 RemoteCallbacks: RemoteCallbacks{
61 CertificateCheckCallback: func(cert *Certificate, valid bool, hostname string) error {
62 return assertHostname(cert, valid, hostname, t)
63 },
64 },
65 }
66
67 err = remote.Fetch([]string{}, &options, "")
68 checkFatal(t, err)
69}
70
71func TestRemoteConnect(t *testing.T) {
72 t.Parallel()

Callers

nothing calls this directly

Calls 7

createTestRepoFunction · 0.85
cleanupTestRepoFunction · 0.85
checkFatalFunction · 0.85
assertHostnameFunction · 0.85
FetchMethod · 0.80
FreeMethod · 0.65
CreateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…