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

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

问题描述

我想用HTTPS在我的ASP.NET Web应用程序,但只适用于为Login.aspx页面。

这怎么可能实现呢?


解决方案

  1. 首先获取或创建证书


  2. 获取从<一的SecureWebPageModule模块href=\"http://www.$c$cproject.com/Articles/7206/Switching-Between-HTTP-and-HTTPS-Automatically-Ver\">http://www.$c$cproject.com/Articles/7206/Switching-Between-HTTP-and-HTTPS-Automatically-Ver.说明安装程序可以在文章中找到。


  3. 添加secureWebPages标签的web.config

     &LT;结构&gt;
        ...
        &LT; secureWebPages启用=真正的&GT;
            ...
        &LT; / secureWebPages&GT;
        ...
        &LT;&的System.Web GT;
            ...
        &LT; /system.web>
    &LT; /结构&gt;


  4. 添加文件和目录是使用了https协议:

     &LT;启用=真正的&GT secureWebPages;
        &LT;文件路径=的Login.aspx/&GT;
        &LT;文件路径=管理/ Calendar.aspx忽略=真/&GT;
        &LT;文件路径=会员/ Users.aspx/&GT;
        &LT;目录路径=管理/&GT;
        &LT;目录路径=会员/安全/&GT;
    &LT; / secureWebPages&GT;


希望这有助于!

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!

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

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