我已经带上了证书,httpItem里也有设置CerPath
我做过以下尝试
1、如果httpItem里不增加ProtocolVersion = HttpVersion.Version20
那么,会提示:
The SSL connection could not be established, see inner exception. Unable to cast object of type 'System.Security.Cryptography.X509Certificates.X509Certificate' to type 'System.Security.Cryptography.X509Certificates.X509Certificate2'.
强制增加
request.ClientCertificates.Add(new X509Certificate2(item.CerPath));
则提示:
An error occurred while sending the request. Unable to read data from the transport connection: 远程主机强迫关闭了一个现有的连接。.
2、如果增加ProtocolVersion = HttpVersion.Version20
则回提示配置参数时出错:Only HTTP/1.0 and HTTP/1.1 version requests are currently supported.Parameter name: value”