MCPcopy
hub / github.com/kagent-dev/kagent / TestBuildHTTPClient_CustomCA

Function TestBuildHTTPClient_CustomCA

go/adk/pkg/models/tls_test.go:96–106  ·  view source on GitHub ↗

Should accept custom CA if specified

(t *testing.T)

Source from the content-addressed store, hash-verified

94
95// Should accept custom CA if specified
96func TestBuildHTTPClient_CustomCA(t *testing.T) {
97 srv := newTLSServer(t)
98 caPath := serverCAPEMPath(t, srv)
99 client, err := BuildHTTPClient(TransportConfig{TLSCACertPath: &caPath})
100 if err != nil {
101 t.Fatalf("unexpected error: %v", err)
102 }
103 if status := get(t, client, srv.URL); status != http.StatusOK {
104 t.Errorf("expected 200, got %d", status)
105 }
106}
107
108// Should accept custom CA if specified and system CAs are disabled
109func TestBuildHTTPClient_CustomCA_DisableSystemCAs(t *testing.T) {

Callers

nothing calls this directly

Calls 4

newTLSServerFunction · 0.85
serverCAPEMPathFunction · 0.85
BuildHTTPClientFunction · 0.85
getFunction · 0.85

Tested by

no test coverage detected