我创建了一个web服务,我从商店获得证书如下
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
X509Store certStore = new X509Store(StoreName.My, StoreLocation.CurrentUser);
certStore.Open(OpenFlags.OpenExistingOnly & OpenFlags.ReadOnly);
X509CertificateCollection clientCertificates = (X509CertificateCollection)certStore.Certificates;
X509Certificate certificate = new X509Certificate();
foreach (X509Certificate Cert in clientCertificates)
{
if (Cert.Issuer.Contains("O=Neutralus,"))
{
certificate = Cert;
}
}
当我测试Web服务并为我获取证书时,这工作正常但是当我部署此服务并从其他计算机访问它时,它会给我以下错误
在SSL流中找不到客户端证书。客户端无法进行身份验证。
我在两台计算机上都安装了证书,并尝试了StoreLocation.LocalMachine
和所有StoreName。