SSL クライアント証明書を除く WCF Rest Webservice を使用し、IIS SSL 設定を「SSL を必要とする」に設定せず、クライアント証明書を「要求」せずに「受け入れる」ようにすることは可能ですか?
私は次の設定を持っています:
<system.serviceModel>
<services>
<service behaviorConfiguration="RestServiceBehaviour" name="PM.WCF.Service.PmRestService">
<endpoint address="" behaviorConfiguration="web" binding="webHttpBinding"
bindingConfiguration="StreamedRequestWebBinding" contract="PM.WCF.Service.IPmRestService" />
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="StreamedRequestWebBinding"
bypassProxyOnLocal="true"
useDefaultWebProxy="false"
hostNameComparisonMode="WeakWildcard"
sendTimeout="10:15:00"
openTimeout="10:15:00"
receiveTimeout="10:15:00"
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647"
maxBufferPoolSize="2147483647"
transferMode="StreamedRequest">
<readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647" />
<security mode="Transport">
<transport clientCredentialType="Certificate"/>
</security>
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="RestServiceBehaviour">
<serviceMetadata httpsGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
私の問題は次の行です:
<transport clientCredentialType="Certificate"/>
この設定を使用し、クライアント証明書を受け入れるように構成されている IIS を使用すると、次のエラーが発生します。
サービス 'SslRequireCert' の SSL 設定が IIS 'SslNegotiateCert' の設定と一致しません。
残念な設定
<transport clientCredentialType="None"/>
どちらも機能しません。ブラウザ/クライアントが証明書を送信していると確信していますがOperationContext.Current.ServiceSecurityContext.PrimaryIdentity.IsAuthenticated
、False
.
1 つは SSL とクライアント証明書を要求するように構成され、もう 1 つは要求しないように構成された 2 つの IIS Web サイトを持つ他の方法はありますか?
たとえそれを回避する方法がないとしても。Visual Studio でこれをデバッグするにはどうすればよいですか? SSL クライアント証明書が必要な瞬間に、Web サービスを開始することはできません。クライアント証明書が見つからないため、 Visual Studio がアクセスhttp://localhost/Foo.WCF.Service/debugattach.aspx
を試みて失敗します。