WCF に関連する証明書/セキュリティの質問がありますが、証明書の理解が不足しているため、苦労しました。より多くの経験を持つ誰かが助けてくれると確信しています:)私が得る.netエラーはSecurityNegotiationExceptionです:エラー:権限を持つSSL / TLSセキュアチャネルの信頼関係を確立できませんでした「[サードパーティのWebサービスアドレス]」
正確な WCF 構成を手伝ってもらえない場合、私が使用している証明書/PFX の目的/タイプをよりよく理解するのを手伝ってくれれば、それは私を大いに助けてくれるでしょう. または、トラブルシューティングのアイデアがあれば、喜んで試してみて、これを最もよく理解できるようにします.
添付している証明書がsoapUIのものと同じであることを確認するにはどうすればよいですか? Fiddler を使用してリクエストを比較するつもりでしたが、soapUI と .net でキャプチャされないというさまざまな問題が発生し、何らかの理由で xml リクエストが表示されません。
詳細情報
とにかく、シナリオについて: 私はサードパーティを扱っており、ブラウザーで Web サービスを起動するために、ローカルコンピューターの信頼できるルートに WS.cert をインストールする必要がありました。
soapUI で提供された実際の例があり、サードパーティのサービスで動作します。何らかの理由で、2 つの pfx ファイル (a.pfx と b.pfx - Channel cert?) が与えられました。それぞれの種類や目的は完全にはわかりませんが、soapUI が機能するには両方が必要でした。彼らが私に言ったのはメッセージ署名証明書-a.pfxであり、次のように設定しました:
a.pfx という名前でここに追加しました: soapUI プロジェクト > プロパティ > WS-Security 構成 > キーストア / 証明書。
そして、soapUI project > properties > WS-Security Configurations > Outgoing WS-Security Configurations の下に、「ws」の構成を追加しました。それに、次の設定で WSS エントリ (タイプ: 署名) を追加しました。
キーストア: a.pfx キー識別子の種類: バイナリ セキュリティ トークン 署名アルゴリズム: http://www.w3.org/2000!09:smldsig#rsa-sha1 署名の正規化: http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments ダイジェスト アルゴリズム: http://www.w3.org/2000/09/xmldsig#sha1 単一の証明書を使用: [このボックスをチェック] 署名に単一の証明書を使用 パーツ: ブランク
そして、b.pfx がどのように機能するかは、soapUI > File > Preferences > SSL Settings KeyStore の下にあります: KeyStore Password が適切に入力された b.pfx が追加されました。しかし、繰り返しになりますが、これが何であり、WCF に取り込む方法がわかりません。
これまでのところ、私の設定の試みはそのように見えます
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<!--Configure the Client Certificate on the client:
http://msdn.microsoft.com/en-us/library/ff648360.aspx#Step8 -->
<behavior name="myBehavior">
<clientCredentials>
<clientCertificate storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint"
findValue="40 char hex thumbprint - removedBeforePosting. Points to b.pfx" />
<serviceCertificate>
<defaultCertificate storeLocation="LocalMachine" storeName="Root" x509FindType="FindByThumbprint"
findValue="40 char hex thumbprint - removedBeforePosting. Points to WS.cert" />
</serviceCertificate>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="myServiceBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="Transport">
<!--I believe the transport also needs Certificate because you can't bring up their ws in a browser w/o their cert -->
<transport clientCredentialType="Certificate" proxyCredentialType="None" realm=""/>
<message clientCredentialType="Certificate" algorithmSuite="Default"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://thirdparty.com:443/Service" behaviorConfiguration="myBehavior" binding="basicHttpBinding" bindingConfiguration="myServiceBinding" contract="ThirdPartyService.IThirdPartyService" name="ThirdPartyService_V2_Port">
<identity>
<certificateReference storeLocation="LocalMachine" storeName="My"
x509FindType="FindByThumbprint" findValue="40 char hex thumbprint - removedBeforePosting. Points to a.pfx" />
<!--<certificate encodedValue="QW4k8wz/BGqIfu2pi0OAyjfQJ5cRiiLk" />-->
<!--tHhfDw/gHv27z52lyMrm4JjP76c=-->
</identity>
</endpoint>
</client>
</system.serviceModel>