从localhost(使用nodejs+ express)发送电子邮件,抛出;
我设置了SendGrid电子邮件API SMTP服务,以从我的应用程序发送电子邮件(使用带有Express的Nodejs)。在从Local主持的主机发送电子邮件时,我会收到以下错误:
Error: unable to get local issuer certificate
at TLSSocket.onConnectSecure (node:_tls_wrap:1532:34)
at TLSSocket.emit (node:events:527:28)
at TLSSocket._finishInit (node:_tls_wrap:946:8)
at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:727:12) {
code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY'
我尝试了禁用选项并使用启用SSL证书,但没有运气。
npm set strict-ssl=false
npm config set registry http://registry.npmjs.org/
npm config set cafile *.pem
I also tried setting the certificates(DigiCertGlobalRootCA & DigiCertTLSECCP384RootG5.crt.pem) on nodejs server startup(refer
您能帮我解决这个问题吗?我们是否需要CA证书来发送电子邮件,如何解决此问题,如何在Nodejs中设置证书?
I have setup SendGrid Email API SMTP service to send email from my app(using NodeJS with express). On sending email from my localhost, I get the below error:
Error: unable to get local issuer certificate
at TLSSocket.onConnectSecure (node:_tls_wrap:1532:34)
at TLSSocket.emit (node:events:527:28)
at TLSSocket._finishInit (node:_tls_wrap:946:8)
at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:727:12) {
code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY'
I tried options to disable and also with enable SSL certificates, but no luck.
npm set strict-ssl=false
npm config set registry http://registry.npmjs.org/
npm config set cafile *.pem
I also tried setting the certificates(DigiCertGlobalRootCA & DigiCertTLSECCP384RootG5.crt.pem) on nodejs server startup(refer https://www.sitepoint.com/how-to-use-ssltls-with-node-js/) but end up with same error.
Can you help me on resolving this issue. Do we need the CA certificates to send emails, how do I fix this problem, how do I set the certificates in NodeJS?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我有同样的问题。在公司笔记本电脑上运行,但不在VPN中运行,即在公司网络中运行。
邮递员正常工作!
一位同事告诉我,我们在笔记本电脑上有一个“本地代理”,我需要经过此操作。而且由于此代理具有自签名证书,因此我需要禁用SSL验证或将其添加到信托店。
对我来说有点了解。
I have the same problem. Running on company laptop but not in VPN, that is, not in the corporate network.
Postman works fine!
A colleague told me that we have a "local Proxy" on the laptop and I need to go through this. And because this proxy has a self signed cert, I need to disable SSL validation or add it to a truststore.
Is a bit much for me to understand.