c# - 如何使用多个 tls 协议
问题描述
所以我有一个当前使用 .net4.6.1 的应用程序,但由于某种原因,配置文件仍然说 targetframework = net4.5 -> 不要问为什么我不能更改它,因为它是一个 cms 系统。
我们正在使用一个到外部 api 端点的帖子,认为它只能使用 tlsv1.2。为了获得这个,我放置了这个代码:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
完美地工作,但我很难打破其他网络客户端:(。
所以其他 webclient 只能使用 tls1.0 或 tls1.1 来管理这个我已更改为以下代码:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls | SecurityProtocolType.Tls12;
好吧,当然我的 tls 异常消失了,但在事件查看器中也没有收到这篇文章。
使用wireshark,客户端使用tls v1.2发送hello,服务器使用tls1.0响应。
知道如何将 httpclient 与 tls1.2 和 webclient 与 v1.0 或 v1.1 一起使用吗?
解决方案
推荐阅读
- javascript - React Lifecycle componentDidUpdate (prevProps, prevState, snapshot)
- python - Django 表单既不显示也不集成在 HTML 中
- automation - 在自动化混合 android 移动应用程序时,一些定位器无法找到
- javascript - How to get slug from an URL JavaScript
- java - 应用程序中的 DB2 到 MSSQL 迁移错误“org.hibernate.MappingException:无法实例化 id 生成器”和“方言不支持序列”
- python - “试图以访问权限禁止的方式访问套接字”,同时尝试访问 spotify api
- haskell - 折叠二叉树时无法匹配预期类型
- ruby-on-rails - RoR 命令“rake routes”中止
- google-colaboratory - Google Colab 中的云 TPU 虚拟机?
- java - 如何在 Android 中以编程方式设置导航抽屉的背景颜色