So I am attempting to turn off TLS 1.0 and 1.1 on my server. When I switch off TLS 1.0 I get the following error in my application:
System.ServiceModel.Security.SecurityNegotiationException: The caller was not authenticated by the service. ---> System.ServiceModel.FaultException: The request for security token could not be satisfied because authentication failed.
at System.ServiceModel.Security.SecurityUtils.ThrowIfNegotiationFault(Message message, EndpointAddress target)
at System.ServiceModel.Security.SspiNegotiationTokenProvider.GetNextOutgoingMessageBody(Message incomingMessage, SspiNegotiationTokenProviderState sspiState)
When TLS 1.0 is enabled everything works fine.
Now the code calling the service is specifying TLS 1.2 using the ServicePointManager
with the following code: ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
The service on the other end is running .Net 4.6.2 and does not specify a TLS protocol using the ServicePointManager
, so from what I have read it will automatically detect which TLS protocol is required at runtime in this version of the .net framework.
The Web.config for the WCF services are the following in regards to the bindings
Calling Config:
<basicHttpBinding>
<binding name="MyBinding" closeTimeout="00:02:00" openTimeout="00:02:00" receiveTimeout="00:02:00" sendTimeout="00:02:00"/>
</basicHttpBinding>
<netTcpBinding>
<binding name="CrossDomainBinding">
<security mode="Message">
<message clientCredentialType="Certificate"/>
</security>
</binding>
</netTcpBinding>
<client>
<endpoint address="net.tcp://MyService.svc"
binding="netTcpBinding" bindingConfiguration="CrossDomainBinding" behaviorConfiguration="CrossDomainBehavior"
contract="MyContract" name="MyBinding">
<identity>
<certificate encodedValue="CERTIFICATEENCODEDVALUE" />
</identity>
</endpoint>
</client>
Service Config:
<bindings>
<netTcpBinding>
<binding>
<security mode="Message">
<message clientCredentialType="Certificate"/>
</security>
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="MyBehaviour">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="false"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceCredentials>
<serviceCertificate findValue="MyCertificate" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName"/>
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
I cannot for the life of me work out what the issue is here.
Does anyone have any idea why when turning off TLS 1.0 this does not work?