在asp.net中启用SSL 4.0和IIS 7.5

编程入门 行业动态 更新时间:2024-10-27 04:28:39
本文介绍了在asp中启用SSL 4.0和IIS 7.5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我创建一个asp 4.0项目。我想启用SSL它。我需要这个映射Web项目在IIS中的新网站。当我尝试创建一个新的网站,我得到:

的结合'*:80:被分配给其他站点。如果您分配相同的结合到这个网站,你将只能启动网站之一。你确定要添加这个重复的绑定?

我试图遵循以下职位:

weblogs.asp/scottgu/archive/2007/04/06/tip-trick-enabling-ssl-on-iis7-using-self-signed-certificates.aspxmscrm4humans.word$p$pss/2010/06/24/enabling-ssl-on-iis-7-0-using-self-signed-certificates/

我的IIS是7.5.7600 ....我完全新的SSL在asp中。请建议解决这个问题。

解决方案

虽然可以配置主机头,你在做什么之后,最简单的方法是用不同的IP地址配置新网站。

添加新的IP地址到服务器,然后设置你的新网站在端口80和443的新的IP地址设置应用程序池使用.NET 4运行绑定,那么对于一个很好的接触,你可以添加一个URLRewrite规则,在你的web.config坚持这一推所有非SSL流量到https:

< system.webServer>      <&改写GT;        <规则与GT;            <规则名称=重定向到HTTPSsto​​pProcessing =真>                <匹配URL =(。*)/>                <条件>                    <添加输入={} HTTPS模式=^ $ OFF/>                &所述; /条件>                <作用TYPE =重定向URL =htt​​ps://开头{HTTP_HOST} / {R:1}redirectType =SeeOther/>            < /规则>        < /规则>    < /重写>< /system.webServer>

或者,如果你想强制SSL然后只需勾选该网站在IIS中的强制SSL 选项。

I have created an asp 4.0 project. I want to enable SSL for it. Do I need to map this web project to new website in IIS. When I try to create a new website, I get:

The binding '*:80:' is assigned to another site. If you assign the same binding to this site, you will only be able to start one of the sites. Are you sure that you want to add this duplicate binding?

I am trying to follow the following posts:

weblogs.asp/scottgu/archive/2007/04/06/tip-trick-enabling-ssl-on-iis7-using-self-signed-certificates.aspx mscrm4humans.wordpress/2010/06/24/enabling-ssl-on-iis-7-0-using-self-signed-certificates/

my IIS is 7.5.7600.... I am totally new to SSL in asp. Please suggest solution to this issue.

解决方案

Whilst it is possible to configure host headers to do what you're after, the easy way is to configure your new site with a different IP address.

Add the new IP address to the server, then setup your binding for the new site to the new IP address on port 80 and 443. Set the app pool to run using .NET 4, then for a nice touch you could add a URLRewrite rule to push all non-SSL traffic to HTTPS by sticking this in your web.config:

<system.webServer> <rewrite> <rules> <rule name="Redirect to HTTPS" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTPS}" pattern="^OFF$" /> </conditions> <action type="Redirect" url="{HTTP_HOST}/{R:1}" redirectType="SeeOther" /> </rule> </rules> </rewrite> </system.webServer>

Or if you wanted to force SSL then just tick the Force SSL option in IIS for the site.

更多推荐

在asp.net中启用SSL 4.0和IIS 7.5

本文发布于:2023-11-12 04:49:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1580550.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:SSL   net   asp   IIS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!