使用 HTTPS 部署 asp.net MVC 1.0 应用程序

发布于 2024-09-14 21:19:52 字数 382 浏览 5 评论 0原文

我们有一个基于 ASP.NET MVC 1.0 构建的应用程序,部署后,应该使用 HTTPS 进行访问。我尝试了几种 HTTPS 方法,但有几个问题:

  1. 我的主页不需要受到保护 (HTTPS),但它后面的其余超链接将受到保护。

  2. 我读到了有关操作方法属性 [requiresHTTPS] 的信息,但是我想了解在本地计算机上开发期间该标记会发生什么情况。

  3. 在开发环境中,如何在开发计算机/虚拟目录上安装证书来编码和测试我的更改。


所以这个应用程序本质上很复杂,我们有大约 13 个控制器和 50 个操作方法。该应用程序将包含信用卡号等信息,因为我们接受通过该网站付款。

非常感谢!

We have an application built on ASP.NET MVC 1.0 which, once deployed, should be accessed with HTTPS. I tried few approaches for HTTPS but I have a few questions.:

  1. My home page does not need to be Secured (HTTPS), but rest of the hyperlinks following it will be Secured.

  2. I read about the action method attribute [requiresHTTPS] however I want to understand what happens to that tag during development on local machine.

  3. In a development enviroment, how do I install a certificate on a dev machine/virtual directory to code and test my changes.


So this application is complex in nature and we have around 13 controllers and 50 action methods. This application will have information like Credit card numbers since we do accept payment through this website.

Thanks much !

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乞讨 2024-09-21 21:19:52

如果只是应用程序中的几个静态页面不需要保护,我强烈建议通过在 IIS 中配置两个不同的站点(一个用于实际的站点)来简单地要求 SSL 来实现一切。页面仅在端口 443 上,一个页面在端口 80 上并具有永久重定向。

优点:

  • 您的应用程序和代码不必了解有关 SSL 的任何信息,并且您的开发计算机上不需要 SSL 证书。网络服务器会为您完成这一切。
  • 没有 cookie 和 HTTP 缓存会干扰 HTTP/HTTPS 触发器
  • 如果安全/隐私很重要,那么对所有页面都要求 SSL 是最好的解决方案。

关于可能的缺点:与应用程序的其余部分相比,通过 SSL 对静态资源提供一些请求可能几乎没有开销。

If it is just about a few static pages of your application that don't need to be secured, I would strongly recommend to simply require SSL for everything by configuring two different sites in IIS, one for the actual page only on port 443, one on port 80 with a permanent redirect.

Advantages:

  • Your application and code doesn't have to know anything about SSL, and you don't need a SSL certificate on your dev machine. The web server does it all for you.
  • No cookie and HTTP caching mess with the HTTP/HTTPS flip-flop
  • If security/privacy matters, it's the best solution anyway to require SSL for all pages.

Regarding the possible disadvantage: serving a few requests on static resources via SSL is probably almost no overhead, compared to the rest of your application.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文