2011-02-18 44 views
0

我创建了自定义成员资格提供程序,并试图使用它来保护我的WCF服务。但是,我得到这个错误:WCF使用成员资格提供程序进行安全保护,但获取证书错误

The service certificate is not provided. Specify a service certificate in ServiceCredentials.

我不想使用X509证书。我怎样才能得到这个工作?

这里是我的服务配置:

<?xml version="1.0"?> 

<bindings> 
    <wsHttpBinding> 
    <binding name="wsHttpBinding1" maxBufferPoolSize="2147483647" 
     maxReceivedMessageSize="2147483647"> 
     <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" 
     maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
     <security mode="Message"> 
     <message clientCredentialType="UserName"/> 
     </security> 
    </binding> 
    </wsHttpBinding> 
</bindings> 
<services> 
    <service name="UpdateService.UpdateService" behaviorConfiguration="ASPNETProviders"> 
    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding1" 
     contract="UpdateService.IUpdateService" /> 
    </service> 
</services> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="ASPNETProviders"> 
     <serviceCredentials> 
     <userNameAuthentication userNamePasswordValidationMode="MembershipProvider" membershipProviderName="myUpdateMembershipProvider"/>    
     </serviceCredentials> 
    </behavior> 
    <behavior>   
     <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> 
     <serviceMetadata httpGetEnabled="true" /> 
     <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> 
     <serviceDebug includeExceptionDetailInFaults="false" /> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" 
    multipleSiteBindingsEnabled="true" /> 

UPDATE

本博客文章,enter link description here,说:

[When] you opt in for the UserName client credential type, WCF insists that your service must also reference a service certificate that contains a private key.

我要举办我的IIS服务,并计划使用SSL证书的网站加密通讯。我可以让WCF不坚持我引用服务证书吗?

+0

谢谢koregan。我认为我们在同一时间正在纠正拼写错误。 – 2011-02-18 13:58:19

回答

相关问题