Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Expose fingerprint capture selecting the wrong endpoint

pulse-triage[bot]4ed767c539a1
diff --git a/pkg/tlsutil/tlsutil_test.go b/pkg/tlsutil/tlsutil_test.go
index f5248f0edd..b773f3d408 100644
--- a/pkg/tlsutil/tlsutil_test.go
+++ b/pkg/tlsutil/tlsutil_test.go
@@ -392,3 +392,22 @@ func TestFingerprintVerifier_TLSVersion(t *testing.T) {
t.Errorf("MinVersion should be %v, got %v", minimumTLSVersion, config.MinVersion)
}
}
+
+// No service listens on these fixed ports in the isolated source-proof guest.
+// The public helper's dial error exposes its actual selected authority, without
+// requiring a privileged listener, a resolver override or an external probe.
+func TestFetchFingerprintEndpointSelection(t *testing.T) {
+ for _, tc := range []struct {
+ name, input, address string
+ }{
+ {"explicit-https-default", "https://127.0.0.1", "127.0.0.1:443"},
+ {"bare-ipv6-default", "::1", "[::1]:8006"},
+ } {
+ t.Run(tc.name, func(t *testing.T) {
+ fingerprint, err := FetchFingerprint(tc.input)
+ if fingerprint != "" || err == nil || !strings.HasPrefix(err.Error(), "failed to connect to "+tc.address+":") {
+ t.Fatalf("capture did not dial the requested authority %s: fingerprint=%q error=%v", tc.address, fingerprint, err)
+ }
+ })
+ }
+}