Skip to content

[FR] Add config option to skip cert validation/verification for SMTP #3709

Closed
@rahilarious

Description

@rahilarious

What did you do?
I have a SMTP server with invalid cert. (accessing via different IP than where domain points to)

What did you expect to see?
a configuration option like insecure_skip_verify in tls_config but for SMTP which allows me to use self-signed/invalid certificate for SMTP.

Environment

  • System information:

    Linux 6.6.14-200.fc39.x86_64 x86_64

  • Alertmanager version:

    alertmanager, version 0.26.0 (branch: HEAD, revision: d7b4f0c)
    build user: root@df8d7debeef4
    build date: 20230824-11:11:58
    go version: go1.20.7
    platform: linux/amd64
    tags: netgo

  • Prometheus version:

    prometheus, version 2.49.1 (branch: HEAD, revision: 43e14844a33b65e2a396e3944272af8b3a494071)
    build user: root@6d5f4c649d25
    build date: 20240115-16:58:43
    go version: go1.21.6
    platform: linux/amd64
    tags: netgo,builtinassets,stringlabels

  • Alertmanager configuration file:

---
global:
  smtp_from: '[email protected]'
  # smtp_smarthost: 'mail.blabla.com:465'
  smtp_smarthost: '10.0.0.1:465'
  smtp_auth_username: '[email protected]'
  smtp_auth_password: 'randompasss'
  smtp_require_tls: false
  # http_config:
  #   tls_config:
  #     insecure_skip_verify: true
  
receivers:
  - name: myreceiver
    email_configs:
      - to: '[email protected]'
route:
  group_by: ['...']
  receiver: myreceiver
...  
  • Logs:
Feb 06 12:47:16 myhost alertmanager[2900]: ts=2024-02-06T07:17:16.900Z caller=notify.go:745 level=warn component=dispatcher receiver=myreceiver integration=email[0] aggrGroup="{}:{alertname=\"loadavg5\", instance=\"10.0.0.1:9100\", job=\"node\"}" msg="Notify attempt failed, will retry later" attempts=1 err="establish TLS connection to server: tls: failed to verify certificate: x509: cannot validate certificate for 10.0.0.1 because it doesn't contain any IP SANs"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions