ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3; System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; System.Net.ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(CheckValidationResult); //证书文件路径 string filePath = "client.p12"; X509Certificate2 cert = new System.Security.Cryptography.X509Certificates.X509Certificate2(filePath, "123456"); this.ClientCertificates.Add(cert);