两个页面接入完成

This commit is contained in:
2026-05-19 22:40:52 +08:00
parent 3daebf56ab
commit 369783939b
32 changed files with 1165 additions and 590 deletions

View File

@@ -0,0 +1,28 @@
using UnityEngine;
using UnityEngine.Networking;
using System.IO;
using System.Security.Cryptography.X509Certificates;
/// <summary>
/// 信任指定自签名证书
/// </summary>
public class SelfSignedCertHandler : CertificateHandler
{
// 受信任的证书数据(从 StreamingAssets 加载)
private X509Certificate2 _trustedCert;
public SelfSignedCertHandler(byte[] certData)
{
_trustedCert = new X509Certificate2(certData);
}
protected override bool ValidateCertificate(byte[] certificateData)
{
// 方法1严格匹配整本证书推荐
var remoteCert = new X509Certificate2(certificateData);
return remoteCert.Thumbprint == _trustedCert.Thumbprint;
// 方法2宽松模式 - 只要证书能解析就信任(调试用,危险)
// return true;
}
}