简体   繁体   English

在便携式HttpClient中支持TLS 1.2和1.1

[英]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? 结合使用带有Microsoft.Net.Http Nuget包的HttpClient,如何默认使用TLS 1.2或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"). 也许使事情变得复杂的是,我使用的目标是:.NET Framework 4.5,Windows 8和Windows Phone Silverlight 8(即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. 基于与Steffen的讨论,我应该澄清一下:如果服务器请求,我想确保HttpClient的便携式版本将支持TLS12和TLS11。 (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. 我确定您现在可能已经解决了,但是当前的pcl实现不支持1.2或1.1,因此,如果服务器要求,则调用将失败。

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 如果您是为iOS或Android开发的,则可以使用ModernHttpClient,它在运行时使用特定于平台的版本,该版本支持1.2和1.1

I am also investigating a solution for use within a pcl library only. 我也在研究仅在pcl库中使用的解决方案。 I will update here when I have found it 找到后我将在这里更新

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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