我收到一封电子邮件,指出我们的服务器需要更新才能在通过 SMTP 向 Amazon SES 发送电子邮件时使用 TLS 1.2。我研究了提到的服务器,涉及的所有层似乎都支持 TLS 1.2。详情请看以下:
Ubuntu 16.04.3 LTS
OpenSSL 1.0.2g
PHP 7.1
Laravel 5.5
Swiftmailer v6.0
Sendmail 8.15.2
以上所有内容都支持 TLS 1.2,所以我不确定为什么 SES 报告 TLS 1.0/1.1 握手。
我正在监控 TLS < 1.2 connections with TCPdump using the following command:
$ tcpdump "tcp port 587 and (tcp[((tcp[12] & 0xf0) >>2)] = 0x16) && (tcp[((tcp[12] & 0xf0) >>2)+9] = 0x03) && ( (tcp[((tcp[12] & 0xf0) >>2)+10] = 0x01) || (tcp[((tcp[12] & 0xf0) >>2)+10] = 0x02))" -X
并将其作为结果的一部分:
"0x0050: e941 7b4f a11f 3444 4f57 4e47 5244 0020 .A{O..4DOWNGRD.."
我假设 DOWNGRD 一定意味着恢复到 1.1 或 1.0。
无论如何运行:
$ openssl s_client -crlf -starttls smtp -connect email-smtp.eu-west-1.amazonaws.com:587 -tls1_2
结果是:
SSL-Session:
Protocol : TLSv1.2
Cipher : ECD........
看来我可以直接建立连接。
任何人都可以建议为什么会发生这种情况或建议任何命令来帮助识别问题吗?
https://github.com/laravel/framework/discussions/41075#discussioncomment-7499514
我没有使用 tls,而是切换到 SSL,如上面评论中所述,它起作用了!