You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are currently porting a library from .NET Framework 4.6.1 to .NET Core 2.1. This is in reference to #24726 , where the issue was Libcurl/LibreSSL and TLS. In 2.1. This was fixed using the new SocketsHttpHandler under the hood. Our next issue is to include the certificate chain in the request.
ServicePointManager.SecurityProtocol=SecurityProtocolType.Tls12;varclient=HttpClientFactory.Create(handler,
... some handlers excluded ...);
In .NET Framework this will result in a handshake with the client certificate and the whole chain up to and including the root certificate. This is not the case in .NET Core, where we only get the certificate itself, causing a server side error:
General SSLEngine problem
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Manually diffing a OK request against a failing, quickly reveals that the biggest difference is that .NET Core is not including the certificate chain.
How can we include the chain in the request? All help is appreciated.
The text was updated successfully, but these errors were encountered:
asjafjell
changed the title
Adding certificate chain to TLS 1.2 connection in .NET core
Adding certificate chain to TLS 1.2 connection in .NET core 2.1
Sep 24, 2018
You are corrcet, @bartonjs! Thank you for the swift reply. For some reason, the certificate was marked as untrusted by macOS. Unsure if it is a result of the Root CA being a certificate to a third party test environment, but a production certificate seems to work perfectly. We will do testing to see if it works with the Root Test CA when flagged as trusted.
We are currently porting a library from .NET Framework 4.6.1 to .NET Core 2.1. This is in reference to #24726 , where the issue was Libcurl/LibreSSL and TLS. In 2.1. This was fixed using the new
SocketsHttpHandler
under the hood. Our next issue is to include the certificate chain in the request.We are currently creating a handler like this:
and using it in a client:
In .NET Framework this will result in a handshake with the client certificate and the whole chain up to and including the root certificate. This is not the case in .NET Core, where we only get the certificate itself, causing a server side error:
Manually diffing a OK request against a failing, quickly reveals that the biggest difference is that .NET Core is not including the certificate chain.
How can we include the chain in the request? All help is appreciated.
The text was updated successfully, but these errors were encountered: