多渠道版本配置网络地址时,http地址替换为了https。由于粗心大意,之前同事遗留的请求框架代码没有对https协议进行 处理,导致在android手机下unity访问https地址进行配置文件下载更新时出现连接超时问题。解决方案:
if (mServerUrl.StartsWith("https", StringComparison.OrdinalIgnoreCase))
{
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
request = WebRequest.Create(mServerUrl) as HttpWebRequest;
request.ProtocolVersion = HttpVersion.Version11;
}
else
{
request = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(mServerUrl);
}
对https的地址 绕过协议校验。