(t *testing.T)
| 117 | } |
| 118 | |
| 119 | func TestBuildHTTPClient_CACertInvalid(t *testing.T) { |
| 120 | t.Parallel() |
| 121 | |
| 122 | // Create a temporary file with invalid content |
| 123 | tempDir := t.TempDir() |
| 124 | caCertPath := filepath.Join(tempDir, "invalid.crt") |
| 125 | err := os.WriteFile(caCertPath, []byte("not a valid certificate"), 0o600) |
| 126 | require.NoError(t, err) |
| 127 | |
| 128 | client, err := buildHTTPClient(false, caCertPath, "", "") |
| 129 | assert.Error(t, err) |
| 130 | assert.Nil(t, client) |
| 131 | assert.Contains(t, err.Error(), "failed to parse CA certificate") |
| 132 | } |
| 133 | |
| 134 | func TestBuildHTTPClient_CertWithoutKey(t *testing.T) { |
| 135 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…