publish: Improve certificate fingerprint output
This commit is contained in:
parent
8f28182111
commit
1abacacab4
1 changed files with 8 additions and 1 deletions
9
main.go
9
main.go
|
@ -350,7 +350,14 @@ func (br *bridge) publish(n *notification) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
hash := sha512.Sum512(rawCerts[0])
|
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
|
tlsCfg.InsecureSkipVerify = true
|
||||||
|
|
Loading…
Reference in a new issue