使用ServicePointManager.SecurityProtocol的线程安全

编程入门 行业动态 更新时间:2024-10-11 01:15:44
本文介绍了使用ServicePointManager.SecurityProtocol的线程安全 - 我需要专家的建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在编写一个系统,其中单独的线程通过HTTPS连接到不同的服务器。 我需要连接的远程服务器之一非常愚蠢(Oracle App Server-10g),并要求我将安全协议降级为SSL3而不是TLS。 <我知道唯一可以使其工作的策略是在属性 SecurityProtocol 。 (更多信息此处)。但也必须与其他需要Tsl安全协议的智能服务器并行处理。 问题: - 由于ServicePointManager是一个静态类, - 并且由于我有几个线程同时从不同的Https服务器消费服务(一些使用Ssl3,一些使用Tls), =>通过在静态 SecurityProtocol之间切换回来是否存在任何潜在的线程问题。 ServicePointManager 从 Ssl3 到 Tls ? =>设置值是 SecurityProtocol。 ServicePointManager "下划线,影响其他线程? Corrolary 问题: =>设置值是 SecurityProtocol。 ServicePointManager ,影响其他应用程序?

I'm writing a system in which separate threads connect to different servers over HTTPS. One of the remote server I need to connect to is really dumb (Oracle App Server-10g) and requires me to downgrade the the Security-Protocol to SSL3 instead of the TLS.The only strategy I know to make it work, is to set the value SecurityProtocolType.Ssl3 in the property SecurityProtocol of the ServicePointManager class. (more info here). But also have to deal in parallel with other smarter servers which are requiring Tsl secutity protocol.Questions: - since ServicePointManager is a static class, - and since I have several threads consumings services from different Https servers at the same time (some with Ssl3, some with Tls), => is there any potential threading problem by switching back in forth between static SecurityProtocol.ServicePointManager from Ssl3 to Tls?=> does setting a value is SecurityProtocol.ServicePointManager in one thread, impact the other threads?Corrolary Question:=> does setting a value is SecurityProtocol.ServicePointManager in one application, impact the other applications?

推荐答案

SecurityProtocolType枚举 msdn.microsoft。 com / zh-cn / library / system.securityprotocoltype.aspx 是Flags属性,因此您可以将其设置为同时使用它们。在SSL握手中,客户端将宣传它支持这两种协议,并且它将从服务器广告中选择最强的协议。 The SecurityProtocolType enumeration msdn.microsoft/en-us/library/system.securityprotocoltype.aspx is a Flags attribute, so you can set it to use both. In the SSL Handshake, the client will advertise that it supports both protocols, and it will chose the strongest from those advertised by the server.

更多推荐

使用ServicePointManager.SecurityProtocol的线程安全

本文发布于:2023-11-05 03:07:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1559738.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:线程   ServicePointManager   SecurityProtocol

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!