如何强制我的.Net应用程序使用TLS而不是SSL Build 与某些Java Web服务的连接?代理到Web服务是作为标准Web引用(而不是WCF)生成的 . Web服务网址是https:// ........
一些细节:从我的.Net 4.0应用程序I 'm invoking Java Web Service hosted on JBoss & Redhat. This web service works properly in 50% runs, when error occurs exception message is '现有连接被远程主机'强行关闭' .
当我查看与WireShark的网络通信时:
-
使用SSL 'Hello Client' Build 所有错误连接并重置 .
-
使用TLSv1 'Hello Client' Build 成功连接
所以迫使.Net使用TLS可以解决这个奇怪的问题 .
1 回答
开始的地方是ServicePointManager.SecurityProtocol . 这允许设置其中一个SecurityProtocolType值:
Ssl3
或Tls
,后者记录在案: