【发布时间】:2015-05-01 10:36:12
【问题描述】:
我将预期的客户端证书设置为“A”:
host.Credentials.ClientCertificate.SetCertificate("A", ...);
host.Credentials.ServiceCertificate.SetCertificate("B", ...);
绑定:
new NetTcpBinding
{
Security =
{
Mode = SecurityMode.TransportWithMessageCredential,
Transport = { ProtectionLevel = ProtectionLevel.EncryptAndSign },
Message = { ClientCredentialType = MessageCredentialType.Certificate }
}
}
我希望服务器只允许具有证书“A”的客户端。但相反,它也允许其他受信任的证书。我已将客户端 app.config 更改为使用“B”而不是“A”,它仍然有效!
我的设置有什么问题?
【问题讨论】:
-
正如您在我的回答中看到的那样,此方法不适用于选择可接受的客户端证书。
标签: c# wcf wcf-binding wcf-security