WCFサービスがHTTPS経由であり、すべての通信がHTTPS経由であることを確認するにはどうすればよいですか?WCFにHTTPSの使用を強制する
言うサービスの私のweb.configファイル内Theresのは何もHTTP :// ...またはhttps:// ....
は、IISで設定されていないHTTPSと私は、Webサービスにアクセスすることができますhttpとhttpsで
とにかくメッセージレベルのセキュリティで暗号化されている場合、これは必須ではありませんか? httpsGetEnabled
がtrueに設定されているとhttpGetEnabled
がfalseに設定されている
<services>
<service name="WcfTransport.Service1" behaviorConfiguration="MyHttpsBehaviour">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransportSecurityBinding" contract="WcfTransport.IService1"/>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors >
<behavior name="MyHttpsBehaviour" >
<serviceMetadata httpsGetEnabled="true" httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="TransportSecurityBinding">
<security mode="Transport">
<transport clientCredentialType="Windows"></transport>
</security>
</binding>
</wsHttpBinding>
</bindings>
なお:ここ
<bindings>
<wsHttpBinding>
<binding name="Binding1" maxReceivedMessageSize="20000000">
<security mode="Message">
<message clientCredentialType="UserName"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
ありがとう、私は@Vano Maisuradzeの答えも ' ' ' 'に変更する必要がありますか?それはうまくいくようでした。 –
Marcus
これは、メタデータの交換やユーザーがサービスディスカバリページを参照する機能(ブラウザでhttp://domain/myservice.svcにアクセスした場合)ではなく、サービス自体(Webサービスビット)のみを変更します。これらがHTTPS経由で動作する必要がある場合は、Vano氏が説明したように、さらに進む必要があります。 –