问题描述
下午好!我使用HttpClient使用Azure Maps API.如何启用对TLS 1.2的支持?据我所知,在Framework 4.6+中受支持.我不应该为此做任何事情?
Good afternoon!I use Azure Maps API using HttpClient.How can I enable support of TLS 1.2?As I know in Framework 4.6+ it is supported. And I should not do anything for this to work?
推荐答案
在 general 中,您无需在应用程序中指定任何配置即可启用最新的TLS协议.
In general you do not need to specify any configuration in your application to enable adoption of the latest TLS protocol.
在 docs.microsoft.com早于.Net 4.7 .
在较高级别,您应该进行审核,以确保您的应用程序不对较低TLS版本产生任何硬性依赖.但除此之外,不需要任何工作.
At high level, you should make audit to make sure your application doesn't take any hard dependency on a lower TLS version. But otherwise no work should be required.
- 在您的应用程序上目标.NET Framework 4.7或更高版本.WCF应用程序上的目标.NET Framework 4.7.1或更高版本.
- 不指定TLS版本.配置您的代码,让操作系统决定TLS版本.
- 执行全面的代码审核,以确认您未指定TLS或SSL版本.
当您的应用允许操作系统选择TLS版本时:
When your app lets the OS choose the TLS version:
- 它会自动利用将来添加的新协议,例如TLS 1.3.
- 操作系统阻止发现不安全的协议.
这篇关于在HttpClient C#中支持TLS 1.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!