Skip to content

[Alerting] email action errors with "self signed certificate" #62372

@pmuellr

Description

@pmuellr

We've seen reports of problems using the email actionType, where the action execution returns a serviceMessage of "self signed certificate".

At least one case was with using the email action with secure: false and no user / password.

Attempting to repro this locally with maildev, I can see the same message.

It seems likely that we may have to use the additional transportConfig of tls.rejectUnauthorized: false for this. When adding that to the action code, you can get a little further sending the email to maildev, but it eventually fails with: Missing credentials for "PLAIN". Although it appears to support running without a user/pass, I couldn't get it to work.

So, changing maildev to use an actual user and pass, and changing the action secrets to add them, the email makes it through.

Here are the changes that were made:

original code:

if (service === JSON_TRANSPORT_SERVICE) {
transportConfig.jsonTransport = true;
delete transportConfig.auth;
} else if (service != null) {
transportConfig.service = service;
} else {
transportConfig.host = host;
transportConfig.port = port;
transportConfig.secure = !!secure;
}

after the transportConfig.secure = !!secure; line, I added:

    if (!transportConfig.secure) {
      transportConfig.tls = {
        rejectUnauthorized: false,
      };
    }

This has the effect that if the action config secure property is false, the tls.rejectUnauthorized nodemailer option is also set to false. Ideally we'd like this as separate config properties of the config, so it can be set independent of secure, but it might be useful to "pair" these nodemailer settings to the secure action config for now.

Metadata

Metadata

Assignees

Labels

Feature:AlertingTeam:ResponseOpsPlatform ResponseOps team (formerly the Cases and Alerting teams) t//

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions