3

I got an error when using nodemailer on localhost, causing an internal server error (500): ERROR: SELF_SIGNED_CERT_IN_CHAIN

I found this thread on the issue: Npm SELF_SIGNED_CERT_IN_CHAIN on Azure, suggesting to do:

npm config set ca ""

but didn't help. also upgrading the npm didn't help:

npm update -g
Community
  • 1
  • 1
Aviram Netanel
  • 12,633
  • 9
  • 45
  • 69

3 Answers3

15

so just when I was about the downgrade my node.js (version 10.32) I found this thread:

SELF_SIGNED_CERT_IN_CHAIN while launching server

suggesting IT'S THE ANTI-VIRUS!!! that is blocking some needed certificates.

after disabling the anti-virus, it worked!

Aviram Netanel
  • 12,633
  • 9
  • 45
  • 69
  • 1
    good call, this really tripped me up since I read this error shows up due to an outdated NPM. Turns out that had nothing to do with it. In my case I'm using Avast and I had to disable that for it to work. – Chris Hawkes Nov 24 '15 at 22:25
10

Disable antivirus "Outbound email scan" SMTP

wanted a way to leave my anti-virus running, and so just disabled the SMTP scan on Avast and all works. Am sure there is a better way, but this works.

eddyparkinson
  • 3,680
  • 4
  • 26
  • 52
7

This is the Node.js recipe to solve this issue:

process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';

Reference - https://github.com/nodemailer/nodemailer/issues/357

Aakash
  • 21,375
  • 7
  • 100
  • 81