我正在编写一个系统,其中单独的线程通过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的线程安全
发布评论