Flash + IE7 + SSL + XML = Epic Fail…

Posted by Dan on Apr 15, 2009 @ 11:26 AM

Yesterday I ran into a very weird issue that one of our users reported. They complained that a Flex component was not working. Originally they described the problem as the Flash wasn't loading at all, but after digging around (and having the user send a screenshot) I realized the Flash was running, but it just wasn't getting the data.

Sure enough, I fired up Internet Explorer 7 and I saw the exact same issue. This was working fine in other browsers (such as Firefox, Safari and Chrome.) I was also having no issues using SSL on our development server. All I can think was "WTF?"

So, off to Google I went looking for an answer.

After some digging, I finally came across Mark Speck's IE7 + SSL + XML? = Flex "Error #2032: Stream Error" post. While I had found a number of similar posts declaring the same problem, every other article I found indicated this was only a problem if the "Cache-Control" header was being sent—which my production server was not sending. However, Mark also documented that this issue could occur with no "Cache-Control" heading—which matched what my production server was doing.

Since I wanted to be able to handle this problem programmatically (because I didn't want this issue to crop up again if we ever migrate servers or add more servers to the cluster,) I decided the best method to solve this problem was to serve up the XML dynamically using ColdFusion. I was able to resolve the problem by moving my XML into a CF template with the following code:

<!---// send the headers //--->
<cfheader name="Content-type" value="text/xml" />
<!---// this is required so IE7 will load the XML over SSL //--->
<cfheader name="Cache-Control" value="no-store, must-revalidate" />
<cfheader name="Pragma" value="public" />
<cfheader name="Expires" value="-1" />
<cfcontent reset="true" />
<xml>
    <goes />
    <here />
</xml>

Thankfully this resolved the issue.

However, I was never able to figure out why I was not having the problem in our development environment. The headers were virtually the same between the two servers. I'm beginning to think this problem might have also been related to the static XML being served via GZIP over SSL, but my dynamically served file is still being GZIP and is using SSL—so I'm not positive GZIP played a part.

I did find one other solution and that was to serve the static XML over HTTP instead of HTTPS. However, we're forcing traffic over SSL, so that option would work for us.

Categories: HTML/ColdFusion, Flex/Flash

1 Comments

  • Hello Dan,

    It might be GZIP related though for my case...

    I'm having a similar issue, but it's IE6 in my case, and it's Web Services within Flex (so it's XML over Https as well) that's not working. I tried your solution with the 3 response headers, and no luck. My responses are also GZIP, I removed the compression and the issue went away (and without using those 3 response headers of yours)

    -Robert

Comments for this entry have been disabled.