证书链节点js中的自签名证书?

时间:2017-11-13 14:15:55

标签: gmail nodes nodemailer

nodemailer和gmail的代码段

var transporter = nodemailer.createTransport({
        host: 'smtp.gmail.com',
        port: 465,
        secure: true,
        // service: 'Gmail',
        auth: {
            user: 'mail_id', 
            pass: 'password'
        }

});

请帮助找到解决问题的错误 - 证书链中的自签名证书

1 个答案:

答案 0 :(得分:1)

您希望重新配置代码,如下所示

var nodemailer = require('nodemailer');
var smtpTransport = require('nodemailer-smtp-transport');

var transporter = nodemailer.createTransport(smtpTransport({         主持人:' smtp.gmail.com',         港口:465,         安全:是的,         //服务:' Gmail',         auth:{             用户:'您的mail_id',             传递:'您的密码'         },         tls:{             rejectUnauthorized:false         }     }));