asp.net - 如何在 ASP.Net 应用程序中使用 HTTPS

标签 asp.net https

我想在 ASP.NET Web 应用程序中使用 HTTPS,但仅限于 Login.aspx 页面。

如何实现这一点?

最佳答案

  1. 首先获取或创建证书

  2. http://www.codeproject.com/Articles/7206/Switching-Between-HTTP-and-HTTPS-Automatically-Ver 获取 SecureWebPageModule 模块。设置说明可在文章中找到。

  3. 将 secureWebPages 标记添加到 web.config

    <configuration>
        ...
        <secureWebPages enabled="true">
            ...
        </secureWebPages>
        ...
        <system.web>
            ...
        </system.web>
    </configuration>
    
  4. 添加用于 https 协议(protocol)的文件和目录:

    <secureWebPages enabled="true">
        <file path="Login.aspx" />
        <file path="Admin/Calendar.aspx" ignore="True" />
        <file path="Members/Users.aspx" />
        <directory path="Admin" />
        <directory path="Members/Secure" />
    </secureWebPages> 
    

希望这有帮助!

关于asp.net - 如何在 ASP.Net 应用程序中使用 HTTPS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/539732/

相关文章:

java - 将 javax.xml.ws.Endpoint 与 HTTPS 结合使用

带有代理授权的 Apache ProxyRemote(通过连接/HTTPS)

asp.net - ASP.Net MVC 中 View 页面上的访问 session

java - j2me和ksoap如何获取asp.net webservice中的特定元素

c# - 如何缩小包含@page的css文件

rest - 如何保护 REST GET 方法的安全?

asp.net - 如何在 Windows Azure 上默认启用 <部署零售 ="true"/>?

javascript - 如何使用 javascript 从 TreeView 中选择 "CheckBoxes"?

与mod_wsgi相关的Django https ssl配置错误

tomcat - 可以使用带有 tomcat 的 cxf 来提供 https 服务(没有码头)