IIS Server Security - Forcing SSL with custom error messages

This is Interesting: Free IT Magazines  
Home > Archive > IIS Server Security > February 2006 > Forcing SSL with custom error messages





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Forcing SSL with custom error messages
J1C

2006-02-02, 5:54 pm

I followed David Wang's instructions but for some reason I can not get
past the redirect... It does fire from HTTP to HTTPS without any
trouble ... but it just sits on the error page ...

<%
if request.servervariables("server_port") = 80 then
dim sslurl : sslurl = "https://"
sslurl = sslurl & request.servervariables("server_name")
sslurl = sslurl & request.servervariables("url")
response.redirect sslurl
end if
%>

Ken Schaefer

2006-02-03, 2:54 am


"J1C" <just1coder@yahoo.ca> wrote in message
news:1138917813.987660.285660@g14g2000cwa.googlegroups.com...
:I followed David Wang's instructions but for some reason I can not get
: past the redirect... It does fire from HTTP to HTTPS without any
: trouble ... but it just sits on the error page ...

If it's just sitting on the error page, how is the transition to HTTPS
occuring?
I'm a bit confused as to what you are actually seeing.

Cheers
Ken


J1C

2006-02-17, 10:41 pm

I did it a little differently and this seems to work:

<%
if request.servervariables("https") = "off" then
response.redirect "https://" & request.servervariables("http_host")
end if
%>

It looks like querystrings get ripped off though - any way to fix that?

Ken Schaefer

2006-02-20, 8:48 pm

Request.ServerVariables("HTTP_Host") only contains the Host name.

Request.ServerVariables("QueryString") will contain the querystrings.

And you'll probably want the page name as well...

Cheers
Ken


"J1C" <just1coder@yahoo.ca> wrote in message
news:1140191781.717597.315030@g47g2000cwa.googlegroups.com...
:I did it a little differently and this seems to work:
:
: <%
: if request.servervariables("https") = "off" then
: response.redirect "https://" & request.servervariables("http_host")
: end if
: %>
:
: It looks like querystrings get ripped off though - any way to fix that?
:


J1C

2006-02-26, 10:27 am

Yes... I caught that right after I posted Thanks Ken.

Cheers

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com