5

We are using nodemailer and mandrill smtp.

Started today we got this error for few different web services

Error: { [Error: certificate has expired] code: 'CERT_HAS_EXPIRED' }

It happens for localhost and remote servers for different web applications What can be the reason?


this was a problem on mandrill side

UPDATE

Expired Certificate Errors A roll out of new certificates last week has caused some users to experience problems sending mail—this was due to the expiration of the old certificate and an issue in our configuration. The users effected were sending through SMTP with STARTTLS. HTTPS API calls were not affected. We are currently working on a fix and will update when resolved. 12:21 PM UTC The configuration error was corrected at 12:05 UTC. SMTP with STARTTLS is now working correctly in all regions. December 18, 2015 12:04 PM UTC

Nedudi
  • 5,639
  • 2
  • 42
  • 37

3 Answers3

16

I was getting same error. Use below in transport config :

tls: {rejectUnauthorized: false},

For Example :

var transporter = nodemailer.createTransport({
host: 'smtp.example.com',
port: 587,
auth: {
    user: 'username',
    pass: 'userpassword'
},
tls: {rejectUnauthorized: false} });
Arvind Kushwaha
  • 759
  • 2
  • 10
  • 18
4

Also: http://status.mandrillapp.com/

18 Dec some certificates of theirs expired

Dev
  • 76
  • 5
  • https://twitter.com/mandrillapp?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor – Dev Dec 18 '15 at 13:58
  • yep, Expired Certificate Errors A roll out of new certificates last week has caused some users to experience problems sending mail—this was due to the expiration of the old certificate and an issue in our configuration. The users effected were sending through SMTP with STARTTLS. HTTPS API calls were not affected. We are currently working on a fix and will update when resolved. 12:21 PM UTC The configuration error was corrected at 12:05 UTC. SMTP with STARTTLS is now working correctly in all regions. December 18, 2015 12:04 PM UTC – Nedudi Dec 18 '15 at 14:26
0

Add this at the top of your file:

process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';t

Warning This disables HTTPS / SSL / TLS checking across your entire node.js environment. Please see the solution using an https agent below.

Thusithz
  • 736
  • 1
  • 12
  • 33