How to use HTTPS in an ASP.Net Application

后端 未结 5 435
南笙
南笙 2020-11-29 23:51

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

How can this be accomplished?

5条回答
  •  既然无缘
    2020-11-30 00:20

    disclaimer - I was involved in the development of this project

    I would recommend using http://nuget.org/packages/SecurePages/ It gives you the ability to secure specific pages or use Regex to define matches. It will also force all pages not matching the Regex or directly specified back to HTTP.

    You can install it via NuGet: Install-Package SecurePages

    Docs are here: https://github.com/webadvanced/Secure-Page-manager-for-asp.net#secure-pages

    Simple Usage:

    SecurePagesConfiguration.Urls.AddUrl("/cart");
    

    or

    SecurePagesConfiguration.Urls.AddRegex(@"(.*)account", RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.Singleline);
    

提交回复
热议问题