Skip to main content

Microsoft Silverlight

Answered Question HttpWebRequest + IE + SSL results in 404RSS Feed

(0)

bkejser
bkejser

Member

Member

6 points

32 Posts

HttpWebRequest + IE + SSL results in 404

Hi

I have a Silverlight 2.0 application that uploads data from the client to the server. The application functions correctly from Windows when using IE, FF, Safari or Chrome over http. When the application is hosted over https, all the browsers except IE continue to work correctly.

I did some debugging and the server is returning status 200. I confirmed this using Fiddler and by examining the IIS log files. For some when the application is hosted over https and IE is used, the application interprets status 200 as status 404 (i.e not found).

Based on other posts, I assumed that a clientaccesspolicy.xml file would provide a workaround for this problem. However, the application is making no requests to the server for the clientaccesspolicy.xml file. I confirmed this using Fiddler and by examining all the IIS log files.

 

 

 

 

prujohn
prujohn

Contributor

Contributor

3429 points

688 Posts

Re: HttpWebRequest + IE + SSL results in 404

That is interesting and worth investigating, because the first request that I always see when accessing a web service for the first time on my projects is the clientaccesspolicy.xml return.

bkejser
bkejser

Member

Member

6 points

32 Posts

Answered Question

Re: HttpWebRequest + IE + SSL results in 404

Hi

The problem was resolved by changing the http headers related to caching.

Here are the old http headers related to caching:

Cache-Control: no-cache
Pragma: no-cache
Expires: -1

Here are the new http headers related to caching:

Cache-Control: private

I'm assuming the following is occuring:

- IE reads the response
- IE examines the http headers related to caching
- IE purges the response from memory because on the combination of SSL and the http headers related to caching
- Silverlight reads the response
- Silverlight finds an empty response and returns an http status 404 to the calling code

I'm basing this assumption on behavior I've seen before in IE6.

- IE6 makes an http request to a web server over SSL
- The web server returns an http response with a content disposition containing the attachment keyword and with http headers indicating caching is disabled
- IE6 prompts to save or run the file
- The user selects run
- IE6 downloads then immediated removes the file because of the combination of SSL and the http headers related to caching
- IE6 shows an error dialog indicating that the file does not exist

I'm also assuming that Silverlight has no means of resolving this issue as it has no means of examining the http response that was flushed from memory.



  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities