Exchange

Exchange 2016 伺服器拒絕證書過期

  • June 26, 2020

我們使用 TLS 從我們 DMZ 中的 Windows 2012R2(未加入域)Web 伺服器發送到我們的內部 Exchange 2016 伺服器(也在 Windows 2012R2 上執行)。直到大約一個月前,當他們停止通過時,這一直執行良好(我們現在才注意到它,因為電子郵件非常罕見)。我強制通過測試郵件,當我查看傳輸角色協議日誌時,我看到以下內容:

2020-06-24 11:02:33.524,
 MAILSERVER\Client Frontend MAILSERVER,
 0102030405060708,
 6,
 192.168.1.44:587,
 192.168.2.3:64961,
 *,
 " CN=*.example.com CN=Sectigo RSA Domain Validation Secure Server CA, O=Sectigo Limited, L=Salford, S=Greater Manchester, C=GB     
   0102030405060708090A0B0C0D0E0F10
   0102030405060708090A0B0C0D0E0F1011121314
   2020-03-17T19:00:00.000Z 
   2021-03-18T18:59:59.000Z 
   *.example.com;example.com",
 Sending certificate Subject Issuer name Serial number Thumbprint Not before Not after Subject alternate names

2020-06-24 11:02:33.540,
 MAILSERVER\Client Frontend MAILSERVER,
 0102030405060708,
 7,
 192.168.1.44:587,
 192.168.2.3:64961,
 *,
 ,
 TLS negotiation failed with error CertExpired

可以看到證書的有效期為 2020 年 3 月 17 日至 2021 年 3 月 18 日。

客戶端顯示以下錯誤日誌:

SERVER -> CLIENT: 220 mailserver.example.com Microsoft ESMTP MAIL Service ready at Wed, 24 Jun 2020 11:02:32 -0500
CLIENT -> SERVER: EHLO www.example.com
250-SIZE 36700160
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-AUTH GSSAPI NTLM
250-8BITMIME
250-BINARYMIME
250 CHUNKING
CLIENT -> SERVER: STARTTLS
SERVER -> CLIENT: 220 2.0.0 SMTP server ready
Connection failed. Error #2: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed [E:\...\class-smtp.php line 374]SMTP Error: Could not connect to SMTP host.
CLIENT -> SERVER: QUIT
SERVER -> CLIENT: SMTP ERROR: QUIT command failed: Connection: closedSMTP Error: Could not connect to SMTP host.

郵件伺服器上的事件日誌顯示以下事件:

A fatal alert was received from the remote endpoint. The TLS protocol defined fatal alert code is 45.
- System 
- Provider 
    [ Name]  Schannel 
    [ Guid]  {1F678132-5938-4686-9FDC-C8FF68F15C85} 
  EventID 36887 
  Version 0 
  Level 2 
  Task 0 
  Opcode 0 
  Keywords 0x8000000000000000 
- TimeCreated 
    [ SystemTime]  2020-06-24 11:02:33.540386500
  EventRecordID 417754 
  Correlation 
- Execution 
    [ ProcessID]  484 
    [ ThreadID]  1552 
  Channel System 
  Computer mailserver.example.com 
- Security 
    [ UserID]  S-1-5-18 
- EventData 
   AlertDesc 45 

但是,同樣,這個事件只是表明一個過期的證書。

關於為什麼 Exchange 認為證書已過期的任何想法?我已經檢查了兩台機器上的日期/時間,它們對第二台機器都是正確的。謝謝!

您的資訊未顯示使用的鏈證書 - 嘗試openssl s_client -connect $host:$port -servername $host -showcerts執行每個生成的 PEM 塊openssl x509 -text,或者如果您更喜歡將它們放入(單獨的)文件並點兩下。(如果您不再需要 OpenSSL 1.1.1 -servername $host。)

許多 Comodo^WSectigo CA 使用 USERTrust-to-AddTrust 橋,該橋於 5 月 30 日到期;請參閱https://security.stackexchange.com/questions/232978/how-to-fully-view-cross-signed-certificate-signatureshttps://stackoverflow.com/questions/62107431/curl-error-60-ssl -certificate-problem-certificate-has-expired並從這兩個連結https://support.sectigo.com/articles/Knowledge/Sectigo-AddTrust-External-CA-Root-Expiring-May-30-2020。特別是 Sectigo RSA DV 伺服器的唯一透明記錄證書是 USERTrust RSA下的https://crt.sh/?id=924467861 ,它在https://crt.sh/?caid=1167列出了四個已知證書因此,如果您使用的是 AddTrust #4860286,您可以看到它的 notAfter 是 2020-05-30——大約一個月前。

這正是 joeqwerty 上面所說的,您是否檢查了分配給證書或綁定到連接器的 SMTP 服務?

您可以執行以下命令進行檢查:

Get-ReceiveConnector | FL Identity,RemoteIPRanges,PermissionGroups,Auth*,TlsCertificateName

有關更多詳細資訊:為 Exchange Server 接收連接器配置 TLS 證書名稱

引用自:https://serverfault.com/questions/1022772