How to use HTTPS in an ASP.Net Application


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

How can this be accomplished?

Best Solution

  1. First get or create a certificate

  2. Get the SecureWebPageModule module from Instructions for setup can be found in the article.

  3. Add secureWebPages tag to web.config

        <secureWebPages enabled="true">
  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" />

Hope this helps!