繁体   English   中英

安全的Web服务器asp.net

[英]secure web server asp.net

我的公司产品具有图形用户界面。 我想保护在客户端和服务器之间来回发送的数据。

SSL是其中之一吗? 如果是,请some1告诉我如何在我的应用程序代码中实现它的步骤。

我需要购买证书还是可以做?。这是最佳选择?

任何帮助表示赞赏。 谢谢..

我使用FormsAuthenticationTicket登录,如下所示:

Session["userName"] = UserName.Text;
                    Session["password"] = Password.Text;
                    Session["domain"] = Domain.Text;
                    string role = "Administrators";

                    // Create the authentication ticket
                    FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket(1,                          // version
                                                   UserName.Text,           // user name
                                                   DateTime.Now,               // creation
                                                   DateTime.Now.AddMinutes(60),// Expiration
                                                   false,                      // Persistent 
                                                   role);         // User data

                    // Now encrypt the ticket.
                    string encryptedTicket = FormsAuthentication.Encrypt(authTicket);
                    // Create a cookie and add the encrypted ticket to the
                    // cookie as data.
                    HttpCookie authCookie =
                                 new HttpCookie(FormsAuthentication.FormsCookieName,
                                                encryptedTicket);

                    // Add the cookie to the outgoing cookies collection.
                    Response.Cookies.Add(authCookie);

                    // Redirect the user to the originally requested page 
                    Response.Redirect(FormsAuthentication.GetRedirectUrl(UserName.Text, false));

我不确定这有多安全? 有什么建议么。

SSL是其中之一吗?

这是唯一明智的

如果是,请some1告诉我如何在我的应用程序代码中实现它的步骤。

假设您正在使用浏览器(而不是您自己的客户端应用程序,然后通过HTTP与服务器通信)。 您不会使用SSL接近您的应用程序代码(除了确保URI是https之外)。

您只需在服务器上安装SSL证书即可。

我需要购买证书还是可以做?。这是最佳选择?

您可以生成一个自签名证书,但是这会生成有关用户浏览器信任的可怕警告。 如果用户在技术上精通,或者您有资源事先在所有客户端上安装证书(并将其标记为受信任),则可以。 否则,您可能应该购买一个。

在.NET代码使用身份验证将无法保证通信“上线”。 SSL是保护浏览器和Web服务器之间的网络流量的选项。 您需要购买安全证书,并配置Web服务器(不是你的ASP.NET应用程序)使用的证书。

SSL确实是一个可能性。 看一看: http://support.microsoft.com/kb/813829

你可能需要改变,虽然代码(见上面的链接)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM