You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since late January 2020, English Wikipedia/Wikisource (and probably everything else) required TLS 1.2 for connections. Framework 4.5 by default only goes up to 1.1. (Framework 4.8 uses the OS default, which is 1.2 on Windows 10). This makes the demo apps fail on startup.
If using 4.5, it's necessary to execute the following somewhere before the first HTTP transaction:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
(using System.Net)
Verified by adding the line to the console and WPF apps, but it should probably be in the API in a path that's always executed during initialization.
The text was updated successfully, but these errors were encountered:
Addendum: the problem with the 4.5 workaround is that it isn't future-proof (one day WP may require 1.3 for example). Fx 4.7 is slightly better; currently TLS1.2 is the Win10 default:
ServicePointManager.SecurityProtocol = SecurityProtocolType.SystemDefault;
Fx 4.8 lets you apply it per-client:
HttpClientHandler.SslProtocols = SslProtocols.None;
which again lets the OS decide. Or you can specify a collection of protocols, currently only up to TLS1.3.
Thanks for your detailed report! I feel that choosing the correct TLS version is the responsibility of WCL users. After all, not all users are using this library against WP, and I don't think it a good idea to do global configuration change in our library "for sake of" consumer.
However, I think we may offer some clearer error message, providing a link to FAQ for this purpose...
OK, but at least let's add the fix to the demo apps (which would also be a good model). I can volunteer to do that; I need to learn how to handle pull requests anyway... You can provide the error message; it will require unpicking the big AggregateException, I think.
Since late January 2020, English Wikipedia/Wikisource (and probably everything else) required TLS 1.2 for connections. Framework 4.5 by default only goes up to 1.1. (Framework 4.8 uses the OS default, which is 1.2 on Windows 10). This makes the demo apps fail on startup.
If using 4.5, it's necessary to execute the following somewhere before the first HTTP transaction:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
(using System.Net)
Verified by adding the line to the console and WPF apps, but it should probably be in the API in a path that's always executed during initialization.
The text was updated successfully, but these errors were encountered: