views:

130

answers:

2

I have classic asp web page in which I am calling an XML source using MSXML2 on an IIS box. MSXML2 requires a full URL http://www.dom.com/path etc. and this all work very well until I tried to install on a server behind a content switch on https url.

After some debuging I worked out the that the content switch didn't have path for http traffic so the the call to the http url failed I was able to fix this my change the target url to https.

As this code is used on both http and now https I wanted to switch the the URL type in code so I did have code fork.

I throught this would be easy and that this would do the trick

if Request.ServerVariables("HTTPS") = "off" then 

But no the content switch hold the cert not the web server which is plan http traffic

Can anybody think of way that I can tell what the FULL URL with https/http or any other way I can fix it.

Many thanks Paul

+1  A: 

Its difficult to answer this without detailed knowledge of the appliance which your refer to as a "Content switch", whatever that may be.

Perhaps the best place to start would be with this simple ASP page:-

<%

Dim vntKey

For Each vntKey In Request.ServerVariables
    Response.Write vntKey & " = " & Server.HTMLEncode(Request.ServerVariables(vntKey)) & "<br />"
Next

%>

Hit this via HTTPS on the client, the list of HTTP headers that appears may reveal some additional custom headers added by the appliance which may allow you to make the determination you need.

Edit

An alternative might be to configure your internal server to listen on both port 80 and say 8080. Configure the reverse proxy to forward requests arriving on 443 to port 8080 of your server. Now you can detect HTTPS because the request arrived at 8080 on your internal server.

AnthonyWJones
The content switch is a reverse proxy and it converts all HTTPS request into HTTP to the IIS servers.So I can't do the normal SSL tests
Pbearne
@Pbearne: Ok. Many reverse proxies will add additional headers to the requests that they pass on to the internal server. The above code will allow you to discover any that may be present and may be useful in making a determination.
AnthonyWJones
+1  A: 

You need to modify the content switch to send a special header if the original request came in through https. We use Zeus ZXTM where I work and I can add a traffic rule that says if request begins with https, to add a header called "FROM_SSL" with a value of true. I then check that header on the back end, rather than using the built in stuff.

Chris