首页 > 解决方案 > 证书链中的nodemailer错误自签名证书

问题描述

我的 gmail 帐户也获得了 lesssecureapps 状态

const transporter = nodemailer.createTransport({
      service: 'gmail',
      auth: {
        user: worker_email,
        pass: worker_pass
      }
})

当我尝试

transporter.sendEmail(options)

我有一个错误:

Error: self signed certificate in certificate chain
at TLSSocket.onConnectSecure (_tls_wrap.js:1321:34)
at TLSSocket.emit (events.js:223:5)
at TLSSocket._finishInit (_tls_wrap.js:794:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:608:12) {
  code: 'ESOCKET',
  command: 'CONN'
}

标签: node.jsemailnodemailer

解决方案


请看这个简短的答案:https ://stackoverflow.com/a/64913747/5172977

基本上,它可能与您的传输设置有关。


推荐阅读