在 WebRequest.Create前面加上以下内容,注释的可以不加。
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
//ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
//ServicePointManager.CheckCertificateRevocationList = false;
//ServicePointManager.DefaultConnectionLimit = 512;
//ServicePointManager.Expect100Continue = false;
var htpRequest = (HttpWebRequest)WebRequest.Create(input_url);