Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

I am not having detail information about HTTPS in depth.
I want to change IIS binding from HTTP to HTTPS for all sites and wcf services hosted on IIS Server.

My queries are:
1) If I change the service urls from HTTP to HTTPS will it work?
2) Is it require to add extra binding settings in config file of service.
3) Which things will affect after changing HTTP to HTTPS?
4) I am calling these WCF services by using jquery.ajax(), will it work bye changing only URL of service?

Thanks for your response in advance.

--Avinash
Posted

Your services will work fine under HTTPS, but you do need to make config changes to make it happen. There is a nice Code Project article that you can use a guide (though dated).
Seven simple steps to enable HTTPS on WCF WsHttp bindings[^]

As for what will be affected, both the server and the client need to be updated. You obviously need to change the URLs from HTTP and HTTPS. When dealing with JavaScript, you can potentially run into cross domain access errors because they are sitting behind a secured site now. Without knowing more about your setup, I won't be able to tell you what to expect.
 
Share this answer
 
Comments
Avinash6474 19-Aug-13 4:33am    
Thanks for your suggestion. IT help me lot to understand concept.
I am having a wcf service which was working on basicHttpbinding, now iif I want to host on https IIS what changes are required to do in server config and client config.
--Avinash
How to add HTTPS binding to IIS7 :
1) GO to run -> inetmgr
2) Select Default Web Site -> From right panel options select 'Bindings' -> Add -> select https from select type drop down options
3) Assign SSL certificate for list. You can create your certificate and use here for authentication.
4) Select Default Web Site-> Feature View -> select SSL security -> and set SSL required with accepted value and click on Apply. To change your settings.

How To test :
Select Default Web Site -> You will see Browse:443 in Right pane option
Click on it, it will show IIS page with hppts protocol.

Answers for my questions:
1) If I change the service urls from HTTP to HTTPS will it work?
Yes, but the page from which you are calling service and WCF Service must be under same IIS

2) Is it require to add extra binding settings in config file of service.
Yes, I changed bindings to webHttpBinding.
HTML
<bindings>
     <webhttpbinding>
       <binding name="webHttpBindingClient">
         <security mode="Transport" />
       </binding>
     </webhttpbinding>
   </bindings>

XML
<services>
      <service behaviorconfiguration="ServiceBehaviour" name="Service">
           <endpoint address="" binding="webHttpBinding" behaviorconfiguration="EndpBehaviour" bindingconfiguration="webHttpBindingClient" contract="IService" name="webHttpEndPointBinding" />
           </service>
    </services>


XML
<system.webserver>

   <httpprotocol>
     <customheaders>
       <add name="Access-Control-Allow-Origin" value="*" />
       <add name="Access-Control-Allow-Credentials" value="true" />
       <add name="Access-Control-Allow-Methods" value="POST, GET,OPTIONS" />
       <add name="Access-Control-Max-Age" value="600000" />
       <add name="Access-Control-Allow-Headers" value="content-type" />
       <add name="Content-Type" value="application/json;charset=UTF-8" />


     </customheaders>
   </httpprotocol>
   <modules runallmanagedmodulesforallrequests="true" />
 </system.webserver>

3) Which things will affect after changing HTTP to HTTPS?
- Both HTTP and HTTPs will work fine

4) I am calling these WCF services by using jquery.ajax(), will it work bye changing only URL of service?
- Yes it will work with only URL change
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900