Since upgrading to .Net 4.6.1 I can no longer call a third party web service but get the error 'Could not establish secure channel for SSL/TLS with authority...'. I can workaround this in a couple of ways but I don't find these ways acceptable. a) Add the following line to the code:
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls11 | System.Net.SecurityProtocolType.Tls;
This ensures I do not use Tls1.2 and all works as before with .Net 4.5.2
b) Add the following line to my config file
<AppContextSwitchOverrides value="Switch.System.Net.DontEnableSchUseStrongCrypto=true"/>
This ensures I do not use Tls1.2 and all works as before with .Net 4.5.2
I would rather be able to use Tls1.2 than turn it off for all calls from my application, my application communicates with many third party services and I don't want to limit all communication because of a problem with one.
Using WireShark to diagnose the problem has highlighted that the client certificate is not sent, which clearly leads to this error.
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="def">
<security mode="Transport">
<transport clientCredentialType="Certificate"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://abc" binding="basicHttpBinding" bindingConfiguration="def" contract="ghi" name="jkl"/>
</client>
The ClientCertificate is set in code
I have read many articles on stackoverflow, the most similar / useful is listed below: How to force WCF client to send client certificate?
I have checked:
- Access to the client certificate (private key) is available
- The server certificate is trusted and valid
- The client certificate matches one of the specs the server sent
Converted my binding to a custom binding to specify requireClientCertificate - no effect
<endpoint address="https://abc" binding="customBinding" bindingConfiguration="def" contract="ghi" name="jkl"/>
Can anyone point me to anything else I can check or help me understand why my certificate is not sent?
Update 2nd June I can download the wsdl successfully using my client certificate to authenticate in Chrome but not in either Internet Explorer nor Edge!
I believe that Chrome doesn't use SChannel (as Edge and IE do) for TLS but it's own implementation of SSL/ TLS.
While I'm not 100% sure I'm currently considering that the problem is the server is specifying a signature algorithm for the client certificate that doesn't match the clients signature algorithm. I don't really know enough about how TLS 1.2 works to be sure but from a read of the spec tools.ietf.org/html/rfc5246#section-7.4.4 it seems possible.
See Certificate request in wireshark trace - i.stack.imgur.com/BwmUM.png and certificate details - i.stack.imgur.com/pbKEF.png
Any tls1.2 experts out there?