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://example.com/..." to "http://example.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.
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.
Is your SSL Certificate installed and valid? Does it happen from multiple clients?
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.
精彩评论