From 344ab75bf1d25dfc9ed24eea87aa43584c15860b Mon Sep 17 00:00:00 2001 From: jsokol89 Date: Fri, 24 Dec 2021 20:09:10 +1000 Subject: [PATCH] Fixing Pingdom error for when SSLDownDaysBefore is set even though VerifyCertificate is false (#370) --- pkg/monitors/pingdom/pingdom-monitor.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/monitors/pingdom/pingdom-monitor.go b/pkg/monitors/pingdom/pingdom-monitor.go index 327643de..61111d9b 100644 --- a/pkg/monitors/pingdom/pingdom-monitor.go +++ b/pkg/monitors/pingdom/pingdom-monitor.go @@ -265,10 +265,13 @@ func (service *PingdomMonitorService) addConfigToHttpCheck(httpCheck *pingdom.Ht // Set certificate not valid before, default to 28 days to accommodate Let's Encrypt 30 day renewals + 2 days grace period. defaultSSLDownDaysBefore := 28 - if providerConfig != nil && providerConfig.SSLDownDaysBefore > 0 { - httpCheck.SSLDownDaysBefore = &providerConfig.SSLDownDaysBefore - } else { - httpCheck.SSLDownDaysBefore = &defaultSSLDownDaysBefore + // Pingdom doesn't allow SSLDownDaysBefore to be set if VerifyCertificate isn't set to true + if providerConfig != nil && providerConfig.VerifyCertificate { + if providerConfig.SSLDownDaysBefore > 0 { + httpCheck.SSLDownDaysBefore = &providerConfig.SSLDownDaysBefore + } else { + httpCheck.SSLDownDaysBefore = &defaultSSLDownDaysBefore + } } if providerConfig != nil {