简体   繁体   中英

The request was aborted: Could not create SSL/TLS secure channel - SecurityProtocol behavior

After installing certificate into Local Computer storage of Trusted Root Certification Authorities the .NET WebRequest still throws:

The request was aborted: Could not create SSL/TLS secure channel

ServicePointManager.SecurityProtocol now contains SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls .

After reading Simon Dugré's answer https://stackoverflow.com/a/2904963/121968 , I have set:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;

It works ok. After setting back:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls;

it still works ok . I have two questions:

  1. Why it still works? Is there sort of caching?

  2. And why it was previously working just with flag Ssl3 only and not with both Ssl3 and Tls ?

There is SSL/TLS session resumption, probably that's your case. Maybe you do not have shared TLS1 ciphersuites. The best way to check is to run Wireshark, and see SSL packets for your connection, they are very good explained in Wireshark.

My solution was to add the lines:

 ServicePointManager.Expect100Continue = True
 ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 Or SecurityProtocolType.Tls

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM