From 467f8cd187a3e84fc3865373d21a035f7895f417 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 24 Oct 2023 16:51:42 +0200 Subject: [PATCH] service: convert network certfp to lower-case In tls.Config.VerifyPeerCertificate, we compare it against the result of hex.EncodeToString. --- service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service.go b/service.go index 788bc06..41097b9 100644 --- a/service.go +++ b/service.go @@ -526,7 +526,7 @@ func (fs *networkFlagSet) update(network *database.Network) error { network.Realname = *fs.Realname } if fs.CertFP != nil { - certFP := strings.ReplaceAll(*fs.CertFP, ":", "") + certFP := strings.ToLower(strings.ReplaceAll(*fs.CertFP, ":", "")) if _, err := hex.DecodeString(certFP); err != nil { return fmt.Errorf("the certificate fingerprint must be hex-encoded") }