ウェブ設定:
パスClientCredentials.UserName
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceCredentialsBehavior">
<serviceCredentials>
<serviceCertificate findValue="cool" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName"/>
</serviceCredentials>
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="ServiceCredentialsBehavior" name="Service">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="MessageAndUserName" name="SecuredByTransportEndpoint" contract="IService"/>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="MessageAndUserName">
<security mode="Message">
<message clientCredentialType="UserName"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<client/>
</system.serviceModel>
<system.web>
<compilation debug="true"/>
</system.web>
クライアントCFG:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IService" >
<security mode="Message">
<message clientCredentialType="UserName" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:48097/WCFServer/Service.svc"
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IService"
contract="ServiceReference1.IService"
name="WSHttpBinding_IService">
<identity>
<dns value ="cool" />
</identity>
</endpoint>
</client>
</system.serviceModel>
範囲はClientCredentials.UserName.UserNameを渡すことです/秒でパスワードure接続。 私はエラーが..です
をpluralsight自己証明書とX509証明書をした:
SOAP security negotiation with 'http://localhost:48097/WCFServer/Service.svc' for target 'http://localhost:48097/WCFServer/Service.svc' failed. See inner exception for more details.
のInnerException:
The X.509 certificate CN=cool chain building failed. The certificate that was used has a trust chain that cannot be verified. Replace the certificate or change the certificateValidationMode. A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
どのように私はこの例外を解決することができますか? よろしく、
セルジュ。
**詳細は内部例外を参照してください。** –
X.509証明書CN =クールチェーンビルディングに失敗しました。使用された証明書には、検証できない信頼チェーンがあります。証明書を交換するか、certificateValidationModeを変更します。証明書チェーンは処理されましたが、信頼プロバイダによって信頼されていないルート証明書で終了しました。 – croisharp