mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-04-14 03:15:49 +02:00
Add TLS 1.3 to default security protocols
This commit is contained in:
parent
b5bffdb95b
commit
2927097e8e
@ -10,10 +10,10 @@ public static class WebUtils {
|
||||
private static bool hasMicrosoftBeenBroughtTo2008Yet;
|
||||
private static bool hasSystemProxyBeenEnabled;
|
||||
|
||||
private static void EnsureTLS12() {
|
||||
private static void EnsureModernTLS() {
|
||||
if (!hasMicrosoftBeenBroughtTo2008Yet) {
|
||||
#pragma warning disable CS0618
|
||||
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;
|
||||
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12 | SecurityProtocolType.Tls13;
|
||||
ServicePointManager.SecurityProtocol &= ~(SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11);
|
||||
#pragma warning restore CS0618
|
||||
hasMicrosoftBeenBroughtTo2008Yet = true;
|
||||
@ -30,7 +30,7 @@ public static void EnableSystemProxy() {
|
||||
}
|
||||
|
||||
public static WebClient NewClient(string? userAgent = null) {
|
||||
EnsureTLS12();
|
||||
EnsureModernTLS();
|
||||
|
||||
WebClient client = new WebClient();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user