Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you SSL one page in an a .NET application?

Tags:

.net

iis

ssl

Can you have one page in a .NET application that is https but the rest be http? For instance, just the login page? Does this take extra setup in the application or is it just as simple as an IIS setting?

like image 799
Josh Avatar asked Dec 17 '09 19:12

Josh


2 Answers

Yes you can. I recommend this free open source DLL that lets you designate which pages and folders need SSL and which don't:

http://www.codeproject.com/KB/web-security/WebPageSecurity_v2.aspx

So you can setup a page to be secure in your web.config like this:

<secureWebPages encryptedUri="www.example.com" unencryptedUri="www.example.com" mode="RemoteOnly" >
    <files>
      <add path="/MustBeSecure.aspx" secure="Secure" />
    </files>
</secureWebPages>
like image 59
Keltex Avatar answered Nov 15 '22 06:11

Keltex


There is no native way to do this in IIS or even in the web.config that I know of.

However, this can be done in code.

like image 20
Steve Wortham Avatar answered Nov 15 '22 06:11

Steve Wortham