Wednesday, February 11, 2015

Configure WCF Service wht HTTPS Binding

One of team mate told me that he was unable to use HTTPS  protocol to access the wcf service that hosts in the DMZ Server. even though he can browse the service with https in the browser.


the issue is caused by the wcf configuration in the web.config file and IIS configuration

the article in the MSDN will provide you the step by step guide to help you walk through the process

How to: Configure an IIS-hosted WCF service with SSL


the only thing i really want to mention is that we do not have to specific the web url in the address attribute when we configure the endpoint in the server web.config.

also we have to set the security mode to be Transport in the Binding configuration.

<services>
      <service name="MySecureWCFService.Service1">
        <endpoint address=""
                  binding="basicHttpBinding"
                  bindingConfiguration="secureHttpBinding"
                  contract="MySecureWCFService.IService1"/>

        <endpoint address="mex"
                  binding="mexHttpsBinding"
                  contract="IMetadataExchange" />
      </service>
    </services>
 
 <bindings>
      <basicHttpBinding>
        <binding name="secureHttpBinding">
          <security mode="Transport">
            <transport clientCredentialType="None"/>
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>

No comments:

Post a Comment