(t *testing.T)
| 102 | } |
| 103 | |
| 104 | func TestCertFromSSLCAInfoEnv(t *testing.T) { |
| 105 | tempfile, err := os.CreateTemp("", "testcert") |
| 106 | assert.Nil(t, err, "Error creating temp cert file") |
| 107 | defer os.Remove(tempfile.Name()) |
| 108 | |
| 109 | _, err = tempfile.WriteString(testCert) |
| 110 | assert.Nil(t, err, "Error writing temp cert file") |
| 111 | tempfile.Close() |
| 112 | |
| 113 | c, err := NewClient(NewContext(nil, map[string]string{ |
| 114 | "GIT_SSL_CAINFO": tempfile.Name(), |
| 115 | }, nil)) |
| 116 | assert.Nil(t, err) |
| 117 | |
| 118 | // Should match any host at all |
| 119 | for _, matchedHostTest := range sslCAInfoMatchedHostTests { |
| 120 | pool := getRootCAsForHostFromGitconfig(c, matchedHostTest.hostName) |
| 121 | assert.NotNil(t, pool) |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | func TestCertFromSSLCAInfoEnvIsIgnoredForSchannelBackend(t *testing.T) { |
| 126 | tempfile, err := os.CreateTemp("", "testcert") |
nothing calls this directly
no test coverage detected