diff --git a/Assets/Scripts/Core/ResUpdate/Base/ThreadDownloader.cs b/Assets/Scripts/Core/ResUpdate/Base/ThreadDownloader.cs index 4f43d6cfd..6e75b560d 100644 --- a/Assets/Scripts/Core/ResUpdate/Base/ThreadDownloader.cs +++ b/Assets/Scripts/Core/ResUpdate/Base/ThreadDownloader.cs @@ -9,6 +9,8 @@ using System.Collections.Generic; using UnityEngine; using GameCore; using System.Text.RegularExpressions; +using UnityEngine.Networking; + namespace ResUpdate { public enum DownLoadType @@ -284,13 +286,15 @@ namespace ResUpdate { if (!string.IsNullOrEmpty(httpsReg.Match(url).ToString())) { - ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(ResourceDownloadManager.CheckValidationResult); + ServicePointManager.CheckCertificateRevocationList = true; + ServicePointManager.Expect100Continue = false; + ServicePointManager.ServerCertificateValidationCallback = ResourceDownloadManager.CheckValidationResult; + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls|SecurityProtocolType.Tls12; } var stringBuilder = new StringBuilder(); var fullUrl = stringBuilder.Append(url).Append(fileName).ToString(); webRequest = (HttpWebRequest)WebRequest.Create(fullUrl); - Debug.LogError("url :" + fullUrl); if (downLoadType == DownLoadType.CacheResumeFile) diff --git a/Assets/Scripts/Core/ResUpdate/Manager/ResourceDownloadManager.cs b/Assets/Scripts/Core/ResUpdate/Manager/ResourceDownloadManager.cs index 3b31de94e..d674c90c5 100644 --- a/Assets/Scripts/Core/ResUpdate/Manager/ResourceDownloadManager.cs +++ b/Assets/Scripts/Core/ResUpdate/Manager/ResourceDownloadManager.cs @@ -224,7 +224,30 @@ namespace ResUpdate /// public static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) { - return true; + bool isOk = true; + // If there are errors in the certificate chain, + // look at each error to determine the cause. + if (errors != SslPolicyErrors.None) + { + for (int i = 0; i < chain.ChainStatus.Length; i++) + { + if (chain.ChainStatus[i].Status == X509ChainStatusFlags.RevocationStatusUnknown) + { + continue; + } + chain.ChainPolicy.RevocationFlag = X509RevocationFlag.EntireChain; + chain.ChainPolicy.RevocationMode = X509RevocationMode.Online; + chain.ChainPolicy.UrlRetrievalTimeout = new TimeSpan(0, 1, 0); + chain.ChainPolicy.VerificationFlags = X509VerificationFlags.AllFlags; + bool chainIsValid = chain.Build((X509Certificate2)certificate); + if (!chainIsValid) + { + isOk = false; + break; + } + } + } + return isOk; } /// diff --git a/Assets/Scripts/Editor/ContrastExcelAndPrefab/System.Data.dll b/Assets/Scripts/Editor/ContrastExcelAndPrefab/System.Data.dll deleted file mode 100644 index 08f376502..000000000 Binary files a/Assets/Scripts/Editor/ContrastExcelAndPrefab/System.Data.dll and /dev/null differ diff --git a/Assets/Scripts/Editor/ContrastExcelAndPrefab/System.Data.dll.meta b/Assets/Scripts/Editor/ContrastExcelAndPrefab/System.Data.dll.meta deleted file mode 100644 index 1e5caa640..000000000 --- a/Assets/Scripts/Editor/ContrastExcelAndPrefab/System.Data.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: 3ed5c128ca330e74490283f99fd1ec5c -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: