![](/img/trans.png)
[英]c# calling web service error: “The client certificate is Not provided. Specify a client certificate in client credentials”
[英]TLS 1.2 Error - The client certificate is not provided. Specify a client certificate in ClientCredentials
我们有一个最近更改为TLS 1.2的提供商
与该服务的通信是通过VB.NET编写的Web应用程序完成的
该代码用于以前的安全协议。 根据WCF错误的答案, 不提供客户端证书。 在ClientCredentials中指定一个客户端证书 ,我已经更新了代码,但是现在我收到一条错误消息:
The client certificate is not provided. Specify a client certificate in ClientCredentials.
我是否需要安装证书才能使此代码正常工作,如果可以,该如何做?
Dim binding = New BasicHttpBinding()
binding.Name = "SoapBinding"
binding.Security.Mode = BasicHttpSecurityMode.Transport
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate
binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None
binding.Security.Transport.Realm = ""
binding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.Certificate
Dim NewEndPoint As New EndpointAddress("www.example.com")
Dim _sr As New srT.ConsumerSoapClient(binding, NewEndPoint)
Dim NewSendData As New srT.SomeService
Dim _result As New srT.SomeServiceRepsonse
_result = _sr.ProcessRequest(NewSendData)
上面的代码在VB.NET中,但是我假设答案在C#中是相似的(或相同的)。
谢谢!
我更改了以下代码,然后不需要证书(使用.NET 4.6.1):
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.**None**
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.