开发者

How to force usage TLS instead of SSL in .Net

开发者 https://www.devze.com 2023-01-15 05:56 出处:网络
How can I force my .Net application to establish connectio开发者_如何学Pythonn with some Java Web Service using TLS instead of SSL ?

How can I force my .Net application to establish connectio开发者_如何学Pythonn with some Java Web Service using TLS instead of SSL ? Proxy to Web Service is generated as standard Web Reference (not WCF). Web Service url is https://........ .

Some details: From my .Net 4.0 application I'm invoking Java Web Service hosted on JBoss & Redhat. This web service works properly in 50% runs, when error occurs exception message is 'An existing connection was forcibly closed by the remote host'.

When I looked at network communication with WireShark:

  • all error connections are established with SSL 'Hello Client' and being reset.
  • Success connections are established with TLSv1 'Hello Client'

so forcing .Net to use TLS could resolve this strange issue.


The place to start would be ServicePointManager.SecurityProtocol. This allows one of the SecurityProtocolType values to be set: Ssl3 or Tls, the later is documented:

Specifies the Transport Layer Security (TLS) 1.0 security protocol.

TLS assumes that a connection-oriented protocol, typically TCP, is in use. The TLS protocol is defined in IETF RFC 2246.

0

精彩评论

暂无评论...
验证码 换一张
取 消