Accept all public keys

This commit is contained in:
js6pak committed 2021-04-04 22:18:03 +02:00
1 parent acd629e728
commit eb299fef1d
1 file changed
+27
+27
View File
@@ -0,0 +1,27 @@
using System.Linq;
using HarmonyLib;
using Hazel.Dtls;
using Il2CppSystem.Security.Cryptography.X509Certificates;
namespace Reactor.Networking.Patches
{
internal static class AuthPatches
{
[HarmonyPatch(typeof(X509Certificate2Collection), nameof(X509Certificate2Collection.Contains))]
public static class AcceptCustomCertificatesPatch
{
public static bool Prefix(ref bool __result)
{
var caller = new Il2CppSystem.Diagnostics.StackTrace().GetFrames().First().GetMethod();
if (caller.DeclaringType.FullName == typeof(DtlsUnityConnection).FullName && caller.Name == nameof(DtlsUnityConnection.ProcessHandshake))
{
__result = true;
return false;
}
return true;
}
}
}
}