将IIS绑定从http更改为https [英] Change IIS binding from http to https

查看:959
本文介绍了将IIS绑定从http更改为https的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我没有深入了解HTTPS的详细信息。

我想为IIS服务器上托管的所有站点和wcf服务将IIS绑定从HTTP更改为HTTPS。



我的疑问是:

1)如果我将服务网址从HTTP更改为HTTPS,它是否有效?

2)是否需要在服务的配置文件中添加额外的绑定设置。

3)将HTTP更改为HTTPS后会有哪些影响?

4)我使用jquery.ajax()调用这些WCF服务,它是否可以改变服务的URL?



感谢您的回复。



--Avinash

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

推荐答案

您的服务在HTTPS下可以正常工作,但您需要进行配置更改才能实现。有一个很好的Code Project文章,你可以使用指南(虽然注明日期)。

在WCF WsHttp绑定上启用HTTPS的七个简单步骤 [ ^ ]



至于会受到什么影响,服务器和客户端都需要更新。您显然需要更改HTTP和HTTPS的URL。处理JavaScript时,您可能会遇到跨域访问错误,因为它们现在位于安全站点后面。在不了解您的设置的情况下,我将无法告诉您预期的结果。
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.


如何向IIS7添加HTTPS绑定:

1)GO运行 - > inetmgr

2)选择默认网站 - >从右侧面板选项中选择'Bindings' - >添加 - >从选择类型下拉选项中选择https

3)为列表分配SSL证书。您可以创建证书并在此处用于身份验证。

4)选择默认网站 - >功能视图 - >选择SSL安全性 - >并使用可接受的值设置SSL,然后单击Apply。更改您的设置。



如何测试:

选择默认网站 - >您将在右窗格选项中看到浏览:443

单击它,它将显示带有hppts协议的IIS页面。



我的问题的答案:

1)如果我将服务URL从HTTP更改为HTTPS,它会起作用吗?

是的,但您调用服务和WCF服务的页面必须在同一个IIS下



2)是否需要添加服务配置文件中的额外绑定设置。

是的,我将绑定更改为webHttpBinding。

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.
<bindings>
     <webhttpbinding>
       <binding name="webHttpBindingClient">
         <security mode="Transport" />
       </binding>
     </webhttpbinding>
   </bindings>




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







<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)将HTTP更改为HTTPS后会有哪些影响?

- HTTP和HTTP都可以正常工作



4)我使用jquery.ajax()来调用这些WCF服务,是不是再见改变服务的URL?

- 是的,它只适用于URL更改


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


这篇关于将IIS绑定从http更改为https的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆