mirror of
https://github.com/NuclearPowered/Reactor.git
synced 2026-10-20 01:46:21 +00:00
Accept all public keys
This commit is contained in:
1 parent
acd629e728
commit
eb299fef1d
1 file changed
+27
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user