我有一个在IIS Express上运行良好的SOAP客户端,但是在IIS上发布时会引发以下异常:
System.ServiceModel.Security.SecurityNegotiationException:无法 建立具有权限的SSL / TLS安全通道....
这是使用其安全性选项创建客户端的功能:
internal static MixedBulkServices.MixedBulkServicesClient GetMixedBulkService(string endPoint)
{
//Defines a secure binding with certificate authentication
WSHttpBinding binding = new WSHttpBinding();
binding.Security.Mode = SecurityMode.Transport;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
//Creates ServiceClient, attach transport-binding, Endpoint and the loaded certificate
MixedBulkServices.MixedBulkServicesClient service = new MixedBulkServices.MixedBulkServicesClient(binding, new EndpointAddress(endPoint));
X509Certificate2 cert = new X509Certificate2(GetCertificatePath(), Properties.Settings.Default.PrivateKeyPassword, X509KeyStorageFlags.PersistKeySet);
service.ClientCredentials.ClientCertificate.Certificate = cert;
return service;
}
我已经在服务器中安装了所有.NET 4.6选项和WCF服务。 任何建议将不胜感激