From 1abacacab4d5366f566e8407313e1fa77da49bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Sun, 27 Aug 2023 16:53:19 +0200 Subject: [PATCH] publish: Improve certificate fingerprint output --- main.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index a3a2ccf..9a34f14 100644 --- a/main.go +++ b/main.go @@ -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