~xenrox/ntfy-alertmanager

1abacacab4d5366f566e8407313e1fa77da49bc4 — Thorben Günther 8 months ago 8f28182
publish: Improve certificate fingerprint output
1 files changed, 8 insertions(+), 1 deletions(-)

M main.go
M main.go => main.go +8 -1
@@ 350,7 350,14 @@ func (br *bridge) publish(n *notification) error {
			}

			hash := sha512.Sum512(rawCerts[0])
			return fmt.Errorf("ntfy certificate fingerprint does not match: expected %q, got %q", hex.EncodeToString(hash[:]), configFingerprint)
			var expectedFingerprint string
			for i, b := range hash {
				if i != 0 {
					expectedFingerprint += ":"
				}
				expectedFingerprint += fmt.Sprintf("%02X", b)
			}
			return fmt.Errorf("ntfy certificate fingerprint does not match: expected %q, got %q", expectedFingerprint, br.cfg.Ntfy.CertFingerprint)
		}

		tlsCfg.InsecureSkipVerify = true