【发布时间】:2020-11-30 01:29:10
【问题描述】:
当我将我的 nodejs 版本更新为 12 时,我遇到了 nodemailer 的行为。
现在,当我尝试发送电子邮件时,我得到:
DEBUG Creating transport: nodemailer (6.1.1; +https://nodemailer.com/; SMTP/6.1.1[client:6.1.1])
DEBUG Sending mail using SMTP/6.1.1[client:6.1.1]
DEBUG [9mzLKQAwcwQ] Resolved mail.mycompany.com as xxx.xxx.xxx.xxx [cache miss]
INFO [9mzLKQAwcwQ] Connection established to xxx.xxx.xxx.xxx:587
DEBUG [9mzLKQAwcwQ] S: 220 mail.mycompany.com ESMTP
DEBUG [9mzLKQAwcwQ] C: EHLO [127.0.0.1]
DEBUG [9mzLKQAwcwQ] S: 250-mail.mycompany.com
DEBUG [9mzLKQAwcwQ] S: 250-STARTTLS
DEBUG [9mzLKQAwcwQ] S: 250-PIPELINING
DEBUG [9mzLKQAwcwQ] S: 250-8BITMIME
DEBUG [9mzLKQAwcwQ] S: 250-SIZE 23068672
DEBUG [9mzLKQAwcwQ] S: 250 AUTH LOGIN PLAIN CRAM-MD5
DEBUG [9mzLKQAwcwQ] C: STARTTLS
DEBUG [9mzLKQAwcwQ] S: 220 ready for tls
ERROR [9mzLKQAwcwQ] 139673645745984:error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol:../deps/openssl/openssl/ssl/statem/statem_lib.c:1922:
ERROR [9mzLKQAwcwQ]
DEBUG [9mzLKQAwcwQ] Closing connection to the server using "end"
ERROR Send Error: 139673645745984:error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol:../deps/openssl/openssl/ssl/statem/statem_lib.c:1922:
ERROR
[Error: 139673645745984:error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol:../deps/openssl/openssl/ssl/statem/statem_lib.c:1922:
] {
library: 'SSL routines',
function: 'ssl_choose_client_version',
reason: 'unsupported protocol',
code: 'ESOCKET',
command: 'CONN'
}
INFO [9mzLKQAwcwQ] Connection closed
INFO [9mzLKQAwcwQ] Connection closed
这是我的 SMTP 传输配置:
nodemailer.createTransport({
host: 'mail.mycompany.com',
port: 587,
debug: true,
logger: true,
tls: {
secure: false,
ignoreTLS: true,
rejectUnauthorized: false
},
auth: {
user: 'user',
pass: 'pass'
}
})
如果我更改为 v11 的 最新的 nodejs 版本:11.15.0,一切都会恢复正常。只有v>12 会发生这种情况,因为我尝试使用12.1.0 和12.2.0 并得到与上述相同的错误。
有人尝试相同的行为?有什么建议吗?
注意:我已将 nodemailer 更新到最新版本 6.1.1,正如我在 Q 标题中所说的那样。
【问题讨论】:
-
在使用带有名为 Axios 的不同包的自签名证书时遇到相同的行为。您使用的是自签名证书吗?
标签: javascript node.js nodemailer