这接缝是一个常见的问题,我已经看过这里所有的答案,但没有帮助。
我试图让SSL与basicHttpBinding的和托管在IIS WCF服务工作。 我认为这个问题是在IIS或与证书。 我创建在IIS管理器自签名证书。 我的证书称为“我的电脑”,并也被放置在受信任的根证书。 客户端没有问题,找到该证书。
我的IIS设置启用匿名身份验证,并禁用一切。 还需要SSL并接受客户端证书。 那是对的吗? 我得到一个错误,如果我选择忽略。
我看不出什么毛病我CONFIGS,这是正确的?
服务配置:
<system.serviceModel>
<services>
<service behaviorConfiguration="MyBehaviour" name="BasicHttpSecTest.Service1">
<endpoint name="MyEndPoint" address="https://mycomputer/wp/" binding="basicHttpBinding" bindingConfiguration="ClientCertificateTransportSecurity" contract="BasicHttpSecTest.IService1" />
<!--<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />-->
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MyBehaviour">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceCredentials>
<clientCertificate>
<authentication certificateValidationMode="PeerOrChainTrust" revocationMode="NoCheck"/>
</clientCertificate>
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="ClientCertificateTransportSecurity">
<security mode="Transport">
<transport clientCredentialType="Certificate" />
</security>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
客户端配置:
<system.serviceModel>
<client>
<endpoint address="https://mycomputer/wp/Service1.svc" binding="basicHttpBinding"
bindingConfiguration="MyEndPoint" contract="ServiceSSLref.IService1"
name="MyEndPoint1" behaviorConfiguration="ClientCertificateCredential"/>
</client>
<bindings>
<basicHttpBinding>
<binding name="MyEndPoint">
<security mode="Transport">
<transport clientCredentialType="Certificate" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="ClientCertificateCredential">
<clientCredentials>
<clientCertificate findValue="mycomputer" storeLocation="LocalMachine" storeName="My" x509FindType="FindByIssuerName" />
<serviceCertificate>
<authentication certificateValidationMode="PeerOrChainTrust" revocationMode="NoCheck"/>
</serviceCertificate>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>