ASP.net C# and IIS7 Request.IsSecureConnection Problem
-
Tuesday, June 26, 2012 1:52 PM
Hi
I am setting SSL on my website and it seems that the Request.Request.IsSecureConnection variable doesn't pickup that the page is secure even though the page is being viewed through HTTPS.
When i view the page internally which just runs this segment of code on load:
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; public partial class OnlineServices_test : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { label1.Text = Request.IsSecureConnection.ToString(); } }When view internally (https://localhost/test.aspx) the page shows true, however when the same file is viewed externally (https://<<WebsiteURL>>/test.aspx it shows as false.
Any help or suggestions would be greatly appreciated.
All Replies
-
Friday, June 29, 2012 5:39 AMModerator
The IsSecureConnection attribute is return false because the connection between client and server is not encrypted, you need to ensure that SSL certificate is installed. Here is a similar post.
Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework
- Marked As Answer by Peter pi - MSFTModerator Tuesday, July 03, 2012 1:32 AM

