tags:

views:

53

answers:

3

I have a .net 3.5 site with "require SSL" option checked. After submitting any form I got a message "The page contains both secure and nonsecure items" and if I click "yes", it changes the url from "https://mysite.com/..." to "http://mysite.com:433/...". Does anyone know what can be the problem?

Edit: this happens only when I submit postback. If I type URL manually everything is ok.

A: 

Is your SSL Certificate installed and valid? Does it happen from multiple clients?

tsilb
A: 

This will usually happen when you are sourcing some of your page via SSL (using the https protocol), and some of it from regular HTTP protocol (most likely images or script or css files).

Go through and check which files you have referenced with an absolute path, and change them to relative.

Look for things like this:

<img source="http://somesite.com/myimage.png" />

this image will be delivered insecurely via HTTP, hence the warning in your page.

slugster
A: 

Sorry, this was not the problem of IIS. It was redirect in the code:

UriBuilder url = new UriBuilder();
if (Request.Url.Port != 80)
{
    url.Port = Request.Url.Port;
}

I replaced this with:

UriBuilder url = new UriBuilder(Request.Url);

Now everything fine. Thanks.

duke84