如何在 ASP.Net 应用程序中使用 HTTPS [英] How to use HTTPS in an ASP.Net Application

查看:41
本文介绍了如何在 ASP.Net 应用程序中使用 HTTPS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

如何实现?

解决方案

  1. 首先获取或创建证书

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

  3. 在 web.config 中添加 secureWebPages 标签

    <预><代码><配置>...<secureWebPages enabled="true">...</secureWebPages>...<system.web>...</system.web></配置>

  4. 添加用于 https 协议的文件和目录:

    <文件路径=登录.aspx"/><file path="Admin/Calendar.aspx" ignore="True"/><文件路径="Members/Users.aspx"/><目录路径=管理员"/><目录路径=成员/安全"/></secureWebPages>

希望这有帮助!

I want to use HTTPS in my ASP.NET web application, but only for the Login.aspx page.

How can this be accomplished?

解决方案

  1. First get or create a certificate

  2. Get the SecureWebPageModule module from http://www.codeproject.com/Articles/7206/Switching-Between-HTTP-and-HTTPS-Automatically-Ver. Instructions for setup can be found in the article.

  3. Add secureWebPages tag to web.config

    <configuration>
        ...
        <secureWebPages enabled="true">
            ...
        </secureWebPages>
        ...
        <system.web>
            ...
        </system.web>
    </configuration>
    

  4. Add files and directories to be use for 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> 
    

Hope this helps!

这篇关于如何在 ASP.Net 应用程序中使用 HTTPS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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