opensslを使用してカスタム認証局(CA)を作成しました。それから、私は以前のものとIISからのリクエストを使用して証明書を作成しました。だから私は証明書のチェーンを持っています。その後、私はWCFサービスに2番目のものをバインドしました。次に、クライアントで私のCA証明書を信頼されたルート証明機関にインストールして、私のカスタム証明書を認識できるようにしました。 私のWCFサービスは、現在、単純なhttp接続で実行されています。 サーバー側:WCFサービスとカスタムCA
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="SyncWcfServices.MainServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="ExtendedMaxSize" maxReceivedMessageSize="2147483647">
<security mode="None">
<transport clientCredentialType="None"></transport>
</security>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service name="SyncWcfServices.MainService" behaviorConfiguration="SyncWcfServices.MainServiceBehavior">
<endpoint address="/syncService.svc" binding="wsHttpBinding" bindingConfiguration="ExtendedMaxSize" contract="SyncWcfServices.IMainService"></endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"></endpoint>
</service>
</services>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
クライアント側:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IMainService" maxReceivedMessageSize="2147483647" sendTimeout="00:10:00">
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost/SyncService/SyncService.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IMainService"
contract="SyncServiceReference.IMainService" name="WSHttpBinding_IMainService" />
</client>
</system.serviceModel>
ので、私はSSL接続をサポートするために、この設定を変更する必要があります。私はそれを行う方法を多くの記事を読んだことがありますが、常に2ウェイ証明書のチェックを使用して、サーバーはクライアント証明書をチェックし、クライアントはサーバー証明書をチェックする必要があります。しかし、私はクライアントが私がインストールしたCAを使用してサーバ証明書をチェックしたいだけです。そして、サーバーは以前と同じように通常の認証情報(ユーザー名、パスワード)で確認します。私はセキュリティモードを両側でトランスポートに、サーバーmexエンドポイントをmexHttpsBindingに変更しなければならないと思いますが、次に何をすればよいですか?それを解決するのを手伝ってください。 ありがとうございました!