你可以在.NET应用程序中SSL一页吗?

Jos*_*osh 6 .net iis ssl

你可以在.NET应用程序中有一个页面是https但其余的是http吗?例如,只是登录页面?这是否需要在应用程序中进行额外设置,还是像IIS设置一样简单?

Kel*_*tex 12

是的你可以.我推荐这个免费的开源DLL,它允许您指定哪些页面和文件夹需要SSL,哪些不需要:

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

因此,您可以在web.config中设置一个安全的页面,如下所示:

<secureWebPages encryptedUri="www.example.com" unencryptedUri="www.example.com" mode="RemoteOnly" >
    <files>
      <add path="/MustBeSecure.aspx" secure="Secure" />
    </files>
</secureWebPages>
Run Code Online (Sandbox Code Playgroud)