Alertmanager fails to send SMTP notifications due to "starttls failed" errors regarding certificate hostname validity
Issue
- Alertmanager fails to send SMTP notifications for custom alerts.
-
The following errors stream in the alertmanager container logs:
$ oc -n openshift-monitoring logs -f alertmanager-main-0 -c alertmanager [...] 2019-06-11T09:51:00.326870516Z level=error ts=2019-06-11T09:51:00.326553215Z caller=notify.go:332 component=dispatcher msg="Error on notify" err="starttls failed: x509: certificate is valid for smtp.example.com, not smtp-relay.example.com" 2019-06-11T09:51:00.326900117Z level=error ts=2019-06-11T09:51:00.326668215Z caller=dispatch.go:280 component=dispatcher msg="Notify for alerts failed" num_alerts=1 err="starttls failed: x509: certificate is valid for smtp.example.com, not smtp-relay.example.com"
Environment
- OpenShift Container Platform (OCP) 3.11
- OpenShift Container Platform (OCP) 4
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.