WCF 绑定Https 协议 用CA证书验证,怎配置服务器端config?急急急

zhu_dk 2014-11-28 05:18:55
服务器配置文件:
 <system.serviceModel>
<services>
<service behaviorConfiguration="mySb" name="MyService.Service1">
<endpoint address="" behaviorConfiguration="myEb" binding="webHttpBinding" bindingConfiguration="webBind" contract="MyService.IService1">
<identity>
<certificate />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpsBinding" name="mex" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="mySb">
<!-- 为避免泄漏元数据信息,请在部署前将以下值设置为 false -->
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true"/>
<!-- 要接收故障异常详细信息以进行调试,请将以下值设置为 true。在部署前设置为 false 以避免泄漏异常信息 -->
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceCredentials>
<serviceCertificate storeName="My" x509FindType="FindBySubjectName" findValue="certnew" storeLocation="LocalMachine"/>
<clientCertificate >
<authentication certificateValidationMode="Custom" customCertificateValidatorType="WCFService.CustomX509CertificateValidator,WCFService"/>
</clientCertificate>
</serviceCredentials>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="myEb">
<webHttp helpEnabled="true" automaticFormatSelectionEnabled="true"/>
<clientCredentials>
<clientCertificate storeName="My" x509FindType="FindBySubjectName" findValue="certnew" storeLocation="CurrentUser"/>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="webBind" openTimeout="00:10:00" receiveTimeout="00:10:00" closeTimeout="10:10:00" sendTimeout="00:10:00" maxReceivedMessageSize="2147483647">
<readerQuotas maxStringContentLength="2147483647"/>
<security mode="Transport">
<transport clientCredentialType="None"></transport>
</security>
</binding>
</webHttpBinding>
<customBinding>
<binding name="JsonMapper">
<webMessageEncoding webContentTypeMapperType="Microsoft.Ajax.Samples.JsonContentTypeMapper, JsonContentTypeMapper"/>
<httpTransport manualAddressing="true"/>
</binding>
</customBinding>
</bindings>
<protocolMapping>
<add binding="webHttpBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>

证书名:certnew.cer(客户端已安装)
客户端浏览器访问:找不到证书:certnew.cer,是证书问题还是服务器配置问题呢?
...全文
366 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhu_dk 2014-11-28
  • 打赏
  • 举报
回复
CA证书的名字必须和服务器名字一样吗?

12,162

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧