Skip to content

Commit cc2c9aa

Browse files
committed
[+] Https upgrade
1 parent 5741ee5 commit cc2c9aa

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

AquaMai.Mods/Fix/FixCheckAuth.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,33 @@
33
using HarmonyLib;
44
using Manager;
55
using Manager.Operation;
6+
using MelonLoader;
67

78
namespace AquaMai.Mods.Fix;
89

910
[ConfigSection(exampleHidden: true, defaultOn: true)]
1011
public class FixCheckAuth
1112
{
13+
[ConfigEntry]
14+
private static readonly bool allowHttpsUpgrade = true;
15+
1216
[HarmonyPostfix]
1317
[HarmonyPatch(typeof(OperationManager), "CheckAuth_Proc")]
1418
private static void PostCheckAuthProc(ref OperationData ____operationData)
1519
{
1620
if (Auth.GameServerUri.StartsWith("http://") || Auth.GameServerUri.StartsWith("https://"))
1721
{
1822
____operationData.ServerUri = Auth.GameServerUri;
23+
24+
// Host is used only for "CheckServerHash" and it is disabled now
25+
// it originally contains server's tls cert hash
26+
// So this can be used to transfer ambiguous data
27+
// we use this to notify that we can upgrade the link to https
28+
// as if we originally pass a https link to game, games without CheckServerHash will reject the link because ssl pinning
29+
if (Auth.GameServerHost == "_AquaMai_Upgrade_")
30+
{
31+
____operationData.ServerUri = Auth.GameServerUri.Replace("http://", "https://");
32+
}
1933
}
2034
}
21-
}
35+
}

0 commit comments

Comments
 (0)