Does it need Certificate/License/Registration before launching the website using https?
I want to use the mentioned code in Global.asax file.
protected void Application_BeginRequest(Object sender, EventArgs e)
{
Response.Redirect("https://" + Request.ServerVariables["HTTP_HOST"]
+ HttpContext.Current.Request.RawUrl);
}
First of all, I think you will never reach it, as it will loop in the
Application_BeginRequestover and over as you are redirecting all requests…Maybe what you’re after is redirecting if the request comes from a non secure connection (http), no?
for that, see if the request comes from such connection like:
Secondly, the HTTPS protocol needs to be up and running or you will get a
ERR_SSL_PROTOCOL_ERRORerror thrown.In Visual Studio, you can easily enable https in the project properties
and you will get the untruest warning
As Visual Studio generated (on installation) a default self signed certificated.
In production environment you will need to:
From your comments I have some question myself now…