Andrea Rossini
Andrea Rossini

Reputation: 330

WCF / USD / Dynamics 365: SchUseStrongCrypto loses effect after some time

I know this may seem an old question, but I don't think someone had the same problem in history.

I send a request to Dynamics 365 version 9 to IOrganizationService.Create, and the test is repeatable after what seems to be a dozen of times. At a certain point it doesn't work anymore and I have to restart USD.

The error I get is:

Exception detail:Error during HTTP request to https://xxxxxxxx.api.crm4.dynamics.com/XRMServices/2011/Organization.svc/web?SDKClientVersion=9.0.9002.0. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.  
Server stack trace: 
   in System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
   in System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
   in System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
   in System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
   in System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   in System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   in System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   in System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   in System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   in Microsoft.Xrm.Sdk.IOrganizationService.Create(Entity entity)
   in Microsoft.Xrm.Sdk.WebServiceClient.WebProxyClient`1.ExecuteAction[TResult](Func`1 action)
   in Microsoft.Xrm.Sdk.WebServiceClient.OrganizationWebProxyClient.CreateCore(Entity entity)
   in CustomHostedControls.HiddenController.DoAction(RequestActionEventArgs args)
   in Microsoft.Uii.Csr.Aif.HostedApplication.HostedWpfControl.HandleRequestAction(Object sender, RequestActionEventArgs args)

I already verified all these conditions:

What else I am supposed to check?

Thank you

Upvotes: 0

Views: 263

Answers (1)

Andrea Rossini
Andrea Rossini

Reputation: 330

Somewhere in code I had a line like this:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls;

Solved with this:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls12;

Optimal solution would be to isolate code in an appdomain, anyway.

Upvotes: 0

Related Questions