【问题标题】:Can't connect to outlook SMTP with STARTTLS because of "handshake error"由于“握手错误”,无法使用 STARTTLS 连接到 Outlook SMTP
【发布时间】:2019-03-04 16:51:01
【问题描述】:

我们的 (sendmail) 邮件服务器无法将邮件传递到 Outlook 和 Proofpoint Essentials,因为它们收到的是 403 4.7.0 TLS handhake failed.

例如,在我的 sendmail 日志中,我看到:

Sep 28 07:47:28 vm2 sendmail[1126]: w8SElRTP001126: from=<redacted_sender>, size=1423, class=0, nrcpts=2, msgid=<redacted_msgid>, proto=ESMTP, daemon=TLSMTA, relay=redacted_hostname [redacted_ip]
Sep 28 07:47:31 vm2 sendmail[1562]: STARTTLS=client, error: connect failed=0, SSL_error=5, errno=0, retry=-1
Sep 28 07:47:31 vm2 sendmail[1562]: ruleset=tls_server, arg1=SOFTWARE, relay=redacted_client.mail.protection.outlook.com, reject=403 4.7.0 TLS handshake failed.
Sep 28 07:47:31 vm2 sendmail[1562]: w8SElRTP001126: to=<redacted_recipient>, ctladdr=<redacted_sender> (25404/25405), delay=00:00:04, xdelay=00:00:01, mailer=esmtp, pri=62113, relay=redacted_client.mail.protection.outlook.com. [213.199.154.170], dsn=4.0.0, stat=Deferred: 403 4.7.0 TLS handshake failed.

我的服务器正在运行 CentOS5(是的,我知道:旧),带有 sendmail-8.13.8-10.el5_11 和 openssl-0.9.8e-36.el5_11。我的 sendmail 配置包括:

O CipherList=kDH:AES
O ServerSSLOptions=+SSL_OP_NO_SSLv2 +SSL_OP_NO_SSLv3 +SSL_OP_CIPHER_SERVER_PREFERENCE
O ClientSSLOptions=+SSL_OP_NO_SSLv2 +SSL_OP_NO_SSLv3

我发现的有关此问题的大多数信息都表明要检查证书上的到期日期。
服务器使用我们自己的自签名 CA 证书中的证书,其中 CA 和服务器证书都有有效的到期日期。我认为问题可能出在自签名 CA 证书上,但我不确定,因为 openssl s_client 也因握手失败而失败。 openssl s_client 命令中根本没有定义任何证书:

% openssl  s_client -starttls smtp -connect redacted-client.mail.protection.outlook.com:25 -msg
CONNECTED(00000003)
>>> SSL 2.0 [length 0077], CLIENT-HELLO
    01 03 01 00 4e 00 00 00 20 00 00 39 00 00 38 00
    00 35 00 00 16 00 00 13 00 00 0a 07 00 c0 00 00
    33 00 00 32 00 00 2f 03 00 80 00 00 05 00 00 04
    01 00 80 00 00 15 00 00 12 00 00 09 06 00 40 00
    00 14 00 00 11 00 00 08 00 00 06 04 00 80 00 00
    03 02 00 80 00 00 ff a7 5e b1 c6 2b fe 4e 10 fc
    fb ca 6d 85 4a 39 2b c8 4b 28 78 2e 6c 4c a9 35
    be 5b 87 f5 ed d6 8d
3958:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:188:

指定-tls1时也有类似的失败。

我可以使用相同的命令毫无问题地连接到 gmail 和大多数其他 SMTP 服务器。

我还尝试了在我的 CentOS7 机器上使用 tls1_1tls1_2openssl s_client 命令,但无法连接到 Outlook(但 gmail 可以)。例如:

    centos7% openssl  s_client -starttls smtp -connect client_redacted.mail.protection.outlook.com:25 -msg -tls1_2
    CONNECTED(00000003)
    >>> ??? [length 0005]
        16 03 01 01 1c
    >>> TLS 1.2 Handshake [length 011c], ClientHello
        01 00 01 18 03 03 f6 c5 f9 75 6c 56 06 45 fb 1d
        93 84 f9 9d 6e 88 ea 6e 51 3a 5e 87 32 c1 ac 17
        d8 d7 bf ed 3a d9 00 00 ac c0 30 c0 2c c0 28 c0
        24 c0 14 c0 0a 00 a5 00 a3 00 a1 00 9f 00 6b 00
        6a 00 69 00 68 00 39 00 38 00 37 00 36 00 88 00
        87 00 86 00 85 c0 32 c0 2e c0 2a c0 26 c0 0f c0
        05 00 9d 00 3d 00 35 00 84 c0 2f c0 2b c0 27 c0
        23 c0 13 c0 09 00 a4 00 a2 00 a0 00 9e 00 67 00
        40 00 3f 00 3e 00 33 00 32 00 31 00 30 00 9a 00
        99 00 98 00 97 00 45 00 44 00 43 00 42 c0 31 c0
        2d c0 29 c0 25 c0 0e c0 04 00 9c 00 3c 00 2f 00
        96 00 41 c0 12 c0 08 00 16 00 13 00 10 00 0d c0
        0d c0 03 00 0a 00 07 c0 11 c0 07 c0 0c c0 02 00
        05 00 04 00 ff 01 00 00 43 00 0b 00 04 03 00 01
        02 00 0a 00 0a 00 08 00 17 00 19 00 18 00 16 00
        23 00 00 00 0d 00 20 00 1e 06 01 06 02 06 03 05
        01 05 02 05 03 04 01 04 02 04 03 03 01 03 02 03
        03 02 01 02 02 02 03 00 0f 00 01 01
    <<< ??? [length 0005]
        16 03 03 0d e9
    139972946728864:error:1409E0E5:SSL routines:ssl3_write_bytes:ssl handshake failure:s3_pkt.c:659:
    ---
    no peer certificate available
    ---
    No client certificate CA names sent
    ---
    SSL handshake has read 1806 bytes and written 0 bytes
    ---
    New, (NONE), Cipher is (NONE)
    Secure Renegotiation IS NOT supported
    Compression: NONE
    Expansion: NONE
    No ALPN negotiated
    SSL-Session:
        Protocol  : TLSv1.2
        Cipher    : 0000
        Session-ID:
        Session-ID-ctx:
        Master-Key:
        Key-Arg   : None
        Krb5 Principal: None
        PSK identity: None
        PSK identity hint: None
        Start Time: 1538152469
        Timeout   : 7200 (sec)
        Verify return code: 0 (ok)
    ---

我还尝试了几个不同的建议密码等,但仍然没有乐趣。

outlook 可能需要来自已知 CA 的证书吗?这意味着openssl s_client 问题有点像红鲱鱼,因为它根本没有使用客户端证书。但是,鉴于我无法确定的数据。

有谁知道允许我的服务器发送到 Outlook 的魔法咒语或配置?

【问题讨论】:

    标签: sendmail sslhandshakeexception


    【解决方案1】:

    尝试使用端口 587 而不是 25。

    【讨论】:

      猜你喜欢
      • 2014-07-10
      • 2022-12-28
      • 2020-06-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-03
      • 2018-10-04
      相关资源
      最近更新 更多