简体   繁体   中英

Supporting TLS 1.2 and 1.1 in portable HttpClient

Using the HttpClient with Microsoft.Net.Http Nuget package, how can I default to TLS 1.2 or 1.1?

Perhaps complicating things is that I'm using a PCL that's targeting: .NET Framework 4.5, Windows 8, and Windows Phone Silverlight 8 (ie Profile78 / targetFramework="portable-net45+win8+wp8").

[Update]

Based on the discussion with Steffen I should clarify: I want to ensure that the portable version of HttpClient will support TLS12 and TLS11 if requested by the server. (Revised the title but left the original question.)

I'm sure you've probably worked it out by now but the current pcl implementation does not support 1.2 or 1.1 so if the server requires it the call will fail.

if you are developing for ios or Android you can use ModernHttpClient that uses the platform specific versions at run time which do support 1.2 and 1.1

I am also investigating a solution for use within a pcl library only. I will update here when I have found it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM