WebRequest: Enable TLS 1.2

Fix #1774
Temporary fix. May not work if .NET Framework 4.6+ missing
This commit is contained in:
ReinforceZwei 2021-10-01 14:32:34 +08:00
parent 981dd51a9b
commit eba309191c

View file

@ -7,6 +7,7 @@ using System.Collections.Specialized;
using System.Net.Sockets; using System.Net.Sockets;
using MinecraftClient.Proxy; using MinecraftClient.Proxy;
using System.Net.Security; using System.Net.Security;
using System.Security.Authentication;
namespace MinecraftClient.Protocol namespace MinecraftClient.Protocol
{ {
@ -123,7 +124,7 @@ namespace MinecraftClient.Protocol
if (isSecure) if (isSecure)
{ {
stream = new SslStream(client.GetStream()); stream = new SslStream(client.GetStream());
((SslStream)stream).AuthenticateAsClient(host); ((SslStream)stream).AuthenticateAsClient(host, null, (SslProtocols)3072, true); // Enable TLS 1.2. Hotfix for #1774
} }
else else
{ {