Connections that use insecure protocols transmit data in cleartext. This introduces a risk of exposing sensitive data to third parties.
1const nodemailerClient = require("nodemailer");
2
3let transporter = nodemailerClient.createTransport({
4 service: "gmail",
5 auth: {
6 user: "youremail@gmail.com",
7 pass: "yourpassword"
8 },
9 // Noncompliant: `requireTLS` is set to `false` which is insecure as it disables Transport Layer Security(TLS).
10 requireTLS: false
11});
12
13console.log('Transporter created:', transporter);1const nodemailerClient = require("nodemailer");
2
3let transporter = nodemailerClient.createTransport({
4 service: "gmail",
5 auth: {
6 user: "youremail@gmail.com",
7 pass: "yourpassword"
8 },
9 // Compliant: `requireTLS` is set to `true` which is secure as it enables Transport Layer Security(TLS).
10 requireTLS: true
11});
12
13console.log('Transporter created:', transporter);