mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-23 20:25:56 +00:00
Use certificate-pin trust for the self-signed pipeline fixture
Match the client's existing self-signed pin contract while retaining VerifyConnection. The full TrueNAS suite includes the pin mismatch refusal control; production transport remains unchanged. Contract-Neutral: Test-only trust configuration for a pinned synthetic TLS endpoint; production transport and API unchanged. Change-source: pulse-maintainer
This commit is contained in:
@@ -2247,7 +2247,11 @@ func TestTrueNASPartialReportingPipeline(t *testing.T) {
|
||||
}))
|
||||
defer server.Close()
|
||||
fingerprint := fmt.Sprintf("%x", sha256.Sum256(server.Certificate().Raw))
|
||||
client, err := truenas.NewClient(truenas.ClientConfig{Host: server.URL, APIKey: "synthetic", Fingerprint: fingerprint})
|
||||
// Trust only this fixture certificate via VerifyConnection, rather than
|
||||
// requiring httptest's self-signed certificate to have a public CA chain.
|
||||
// Fingerprint pinning remains enforced (including the existing mismatch
|
||||
// controls in internal/truenas); no production TLS setting is changed.
|
||||
client, err := truenas.NewClient(truenas.ClientConfig{Host: server.URL, APIKey: "synthetic", Fingerprint: fingerprint, InsecureSkipVerify: true})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user