我有一个WPF应用程序,我正在使用WCF通过Https使用php webservice,我在服务器上创建了一个自我签名的证书来测试它并配置客户端使用这个证书,但是一个例外出现并告诉我,我也需要通过客户证书。
实际上我只想保护传输的消息,我不需要对客户端进行身份验证,因此如何禁用客户端身份验证。
我正在使用带有clientCredentialType“Certificate”和.Net 3.5的安全模型“Transport”。
提前感谢您的意见..
更新
正如我所提到的,我不需要该服务来验证客户端的身份,因此我使用了Transport Security with an Anonymous Client而不是Transport Security With Certificate Authentication,以下是客户端配置:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="bindingName" closeTimeout="00:0:04"
openTimeout="00:00:04" receiveTimeout="00:00:04" sendTimeout="00:00:04"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
messageEncoding="Text" textEncoding="utf-8"
useDefaultWebProxy="true">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647">
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="https://myServer/myApp/myWebService"
binding="wsHttpBinding" bindingConfiguration="bindingName"
contract="xx.yy" name="zz">
</endpoint>
</client>
现在问题是:当我调用服务时出现超时错误“对{My Service URL}的HTTP请求已超过分配的超时”。
其他信息:该服务在HTTP上运行良好,只有当我转移到HTTPS时才出现问题,如果我通过互联网浏览器打开它,我可以看到服务WSDL,但浏览告诉我有不安全的资源,我应该强制它向我展示所有资源,以便查看WSDL。
答案 0 :(得分:0)
可能你的问题是:
//创建端点地址。 请注意机器名称
// 必须与X.509证书的主题或DNS字段匹配
// 用于验证服务。
请检查您的客户端配置,并检查证书部分findValue
属性以匹配您的证书。
像
<clientCertificate findValue="contoso.com"
storeLocation="CurrentUser"
storeName="My"
x509FindType="FindBySubjectName" />