Our Dynamics CRM on-premise (v8.2.0.749) has been happily communicating with Exchange Server 2016. That was until last week when the Exchange Server was patched to CU12 and TLS1.2 became the only protocol available for communications.
It was at this point we noticed that the Server Side Synch for mailboxes started failing. We are not sure if TLS 1.2 is supported in CRM 365 on-premise (v8.2.0.749), looking at various blogs it appears it is supported, but only V9 makes it mandatory. Anyhow to avoid any issues with patches etc. I've updated our CRM to v8.2.4.0006 aka update 2.4), but this has had no affect on the mail features.
The following trace logs were captured when I switched on tracing and ran a connection test in the mail server profile:
[2019-05-01 14:51:53.634] Process:CrmAsyncService |Organization:1db0c0b6-ceee-418c-afc3-ebe6dc767040 |Thread: 18 |Category: ExchangeSync |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 00000000-0000-0000-0000-000000000000 |ActivityId: 2cc78fa0-56d2-4f0d-97fd-9a07f79ece35 | EmailConnectorTraceHandler.EmailConnectorTraceFormat ilOffset = 0x13E
>Exchange sync worker for the mailbox is failed/terminated : {0D380767-8C19-E411-80C0-0050569D09D9}. Exception details : Unhandled Exception: Microsoft.Exchange.WebServices.Data.ServiceRequestException: The request failed. The underlying connection was closed: An unexpected error occurred on a send.
> at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.EndGetEwsHttpWebResponse(IEwsHttpWebRequest request, IAsyncResult asyncResult)
> at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.EndInternalExecute(IAsyncResult asyncResult)
> at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.EndExecute(IAsyncResult asyncResult)
> at Microsoft.Exchange.WebServices.Data.ExchangeService.EndSyncFolderHierarchy(IAsyncResult asyncResult)
> at Microsoft.Crm.Asynchronous.EmailConnector.MonitoredExchangeService.EndSyncFolderHierarchy(IAsyncResult asyncResult)
> at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeSyncSteps.ExchangeSyncAsyncRemoteStep`2.AfterCall()
> at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeSyncSteps.ExchangeSyncAsyncRemoteStep`2.Execute()
> at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeSyncWorker.SynchronizeACTs()
>Inner Exception: System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send.
> at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
> at Microsoft.Exchange.WebServices.Data.EwsHttpWebRequest.Microsoft.Exchange.WebServices.Data.IEwsHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
> at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.EndGetEwsHttpWebResponse(IEwsHttpWebRequest request, IAsyncResult asyncResult)
>Inner Exception: System.IO.IOException: The handshake failed due to an unexpected packet format.
> at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
> at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
>.
[2019-05-01 14:51:57.654] Process:CrmAsyncService |Organization:1db0c0b6-ceee-418c-afc3-ebe6dc767040 |Thread: 21 |Category: EmailConnector |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 00000000-0000-0000-0000-000000000000 |ActivityId: 9d47c0ba-750c-4d75-b265-ec8b0bd32331 | EmailConnectorTraceHandler.EmailConnectorTraceFormat ilOffset = 0x13E
>Mailbox : 0d380767-8c19-e411-80c0-0050569d09d9 is an inactive mailbox, we set the postpone time as DateTime Max. LastSyncErrorCode: 52.
This line looks significant: "The handshake failed due to an unexpected packet format. at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)"
Is this evidence that TLS 1.2 isn't supported, or is there likely to be something else wrong here and we are fixated on the wrong problem?
What's the best way to troubleshoot server-side synch errors between CRM and Exchange.
FYI. Both CRM and Exchange are on-premise and TLS1.2 has been enabled as the only protocol on the exchange server.
Many thanks
Steve
*This post is locked for comments