From 8f281821118e782ec2a5f2eed7bc6a143b1b7ea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Fri, 25 Aug 2023 22:43:57 +0200 Subject: [PATCH] config.scfg: Add instructions to obtain cert fingerprint --- config.scfg | 5 ++++- config/config_test.go | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/config.scfg b/config.scfg index 434256d..e1aa5f8 100644 --- a/config.scfg +++ b/config.scfg @@ -53,7 +53,10 @@ ntfy { access-token foobar # When using (self signed) certificates that cannot be verified, you can instead specify # the SHA512 fingerprint. - certificate-fingerprint 136d2b889c5736d081b4b29c7909276292cfb86a6bd3ad4635cb7017eb996e28082ab8c6794bf62e817941981d53c807b35c245fb18eb6fb66b5ddb4d05c299 + # openssl can be used to obtain it: + # openssl s_client -connect HOST:PORT | openssl x509 -fingerprint -sha512 -noout + # For convenience ntfy-alertmanager will convert the certificate to lower case and remove all colons. + certificate-fingerprint 13:6D:2B:88:9C:57:36:D0:81:B4:B2:9C:79:09:27:62:92:CF:B8:6A:6B:D3:AD:46:35:CB:70:17:EB:99:6E:28:08:2A:B8:C6:79:4B:F6:2E:81:79:41:98:1D:53:C8:07:B3:5C:24:5F:B1:8E:B6:FB:66:B5:DD:B4:D0:5C:29:91 # Forward all messages to the specified email address. email-address foo@bar.com # Call the specified number for all alerts. Use `yes` to pick the first of your verified numbers. diff --git a/config/config_test.go b/config/config_test.go index 3daf746..a72e9c9 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -45,7 +45,7 @@ resolved { ntfy { topic https://ntfy.sh/alertmanager-alerts - certificate-fingerprint 136d2b889c5736d081b4b29c7909276292cfb86a6bd3ad4635cb7017eb996e28082ab8c6794bf62e817941981d53c807b35c245fb18eb6fb66b5ddb4d05c299 + certificate-fingerprint 13:6D:2B:88:9C:57:36:D0:81:B4:B2:9C:79:09:27:62:92:CF:B8:6A:6B:D3:AD:46:35:CB:70:17:EB:99:6E:28:08:2A:B8:C6:79:4B:F6:2E:81:79:41:98:1D:53:C8:07:B3:5C:24:5F:B1:8E:B6:FB:66:B5:DD:B4:D0:5C:29:91 user user password pass } @@ -76,7 +76,7 @@ cache { Topic: "https://ntfy.sh/alertmanager-alerts", User: "user", Password: "pass", - CertFingerprint: "136d2b889c5736d081b4b29c7909276292cfb86a6bd3ad4635cb7017eb996e28082ab8c6794bf62e817941981d53c807b35c245fb18eb6fb66b5ddb4d05c299", + CertFingerprint: "13:6D:2B:88:9C:57:36:D0:81:B4:B2:9C:79:09:27:62:92:CF:B8:6A:6B:D3:AD:46:35:CB:70:17:EB:99:6E:28:08:2A:B8:C6:79:4B:F6:2E:81:79:41:98:1D:53:C8:07:B3:5C:24:5F:B1:8E:B6:FB:66:B5:DD:B4:D0:5C:29:91", }, Labels: labels{Order: []string{"severity", "instance"}, Label: map[string]labelConfig{