Tôi cố gắng để cấu hình một WCF server \ client để làm việc với SSLYêu cầu HTTP bị cấm với chương trình xác thực khách hàng 'Anonymous'
tôi nhận được ngoại lệ sau đây:
The HTTP request was forbidden with client authentication scheme 'Anonymous'
Tôi có một tự được lưu trữ trên máy chủ WCF. tôi đã chạy hhtpcfg cả chứng chỉ client và server của tôi được lưu trữ trong Cá nhân và dân tin cậy trên máy Local
Đây là mã máy chủ:
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
binding.Security.Mode = WebHttpSecurityMode.Transport;
_host.Credentials.ClientCertificate.Authentication.CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.PeerOrChainTrust;
_host.Credentials.ClientCertificate.Authentication.RevocationMode = X509RevocationMode.NoCheck;
_host.Credentials.ClientCertificate.Authentication.TrustedStoreLocation = StoreLocation.LocalMachine;
_host.Credentials.ServiceCertificate.SetCertificate("cn=ServerSide", StoreLocation.LocalMachine, StoreName.My);
Khách hàng Mã số:
binding.Security.Mode = WebHttpSecurityMode.Transport;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
WebChannelFactory<ITestClientForServer> cf =
new WebChannelFactory<ITestClientForServer>(binding, url2Bind);
cf.Credentials.ClientCertificate.SetCertificate("cn=ClientSide", StoreLocation.LocalMachine, StoreName.My);
ServicePointManager.ServerCertificateValidationCallback
+= RemoteCertificateValidate;
Xem web_tracelog.svclog và trace.log cho thấy máy chủ không thể tự xác thực chứng chỉ ứng dụng khách Chứng chỉ của tôi không được ký bởi Ủy quyền CA nhưng đây là lý do tại sao tôi đã thêm chúng vào Người đáng tin cậy ....
Tôi bị thiếu gì? Tôi đang thiếu gì?
lệnh thứ hai không thành công với Lỗi: Không thể tải chứng chỉ tổ chức phát hành ('MyCAPublic.cer') – TDaver