IE7 + SSL + XML? = Flex “Error #2032: Stream Error”

I’m developing a Flex application that runs smoothly in Firefox over SSL. Today, I just wanted to verify whether Internet Explorer 7 (IE7) hosts the application as nicely. Somehow, I wasn’t surprised that the Microsoft browser invoked an “Error #2032: Stream Error”.

Don’t assume, test!

Searching brought me to judah’s blog, but the blog is only about URL paths. Because the application runs in Firefox and in non-SSL mode in IE7, this was not causing my problem. However, some comments on judad’s blog and on this blog were interesting: An Adobe TechNote warns of this issue. However, the note was last updated in 2005 what meant that it could not relate to IE7. I also found a Microsoft bug report describing the issue but it only links the bug to IE5 and below. The assumption that Microsoft has corrected this bug since 2005 was probably my biggest mistake in this hole story.

The search could go on. Barton has some nice input and proposes to tamper the HTTP header: remove Pragma and set Cache-Control: no-store. So I did and checked the HTTP headers in the SSL connection with Wireshark (which is also quite bogus for decrypting SSL packets, at least 1.0.0). This made the whole thing running. And in details:

Works:

  1. Cache-Control: no-store
  2. Cache-Control: no-store, must-revalidate
  3. Cache-Control: no-store,max-age=0,must-revalidate
  4. Cache-Control: max-age=0,must-revalidate
  5. Cache-Control: must-revalidate

Does not work:

    1. Pragma: no-cache <+whatever header like Cache-control: no-store>
    2. Cache-control: no-cache
    3. Cache-control: no-cache, must-revalidate
    4. Cache-control: no-cache,<+whatever>
    5. <empty = no Cache-control at all>

      Controlling Cache-Control

      In Firefox, you can check the content of the cache by entering about:cache in the URL. You will notice that Firefox caches all data coming from an SSL connection in memory. Hence, closing a tab does not delete the data but a restart of Firefox does.

      IE7 caches data coming from SSL normally to the disk. The HTTP header Cache-Control: no-store prevents this default behaviour. Unfortunately, I don’t know a similar command like about:cache in IE7, so haven’t investigated the exact caching behaviour. Cache stored on the disk can be checked with “Tools menu > Internet Options > General Tab > Browsing History section > Settings Button >View Files button” but I don’t know how to see the cache in the memory.


      28 Responses to “IE7 + SSL + XML? = Flex “Error #2032: Stream Error””

      1. zlatko Says:

        Emm …. in my case header “Pragma: no-cache” return form always server by default…How i can remove it ? Different calling header(…) from php doesnt help, i however see it in some alike Wireshark app.

      2. faindu Says:

        Hi Zlatko

        Last time I used php is about 8 years ago, so I can’t really help out with php. If you use mod_php or you do the encryption with an apache web server, you can modify headers there. Simply link in mod_headers an add ‘Header set Cache-Control “no-cache,must-revalidate”‘, ‘Header unset Pragma’ to the configuration.

      3. zlatko Says:

        Hi Faindu

        Got it !
        In php.ini leave empty value for key ’session.cache_limiter ‘, and ‘caching’ headers not sended.
        Thx ! ;)

      4. faindu Says:

        All right, thanks for the feedback.

      5. lessrain blog » Blog Archive » Flash: Nasty XML load bug in Internet Explorer Says:

        [...] Marc Speck [...]

      6. lessrain blog » Blog Archive » Flash loading and browser cache test-suite Says:

        [...] Here it’s suggested that “Cache-Control: must-revalidate” and “Cache-Control: max-age=0″ also work. While that’s true in the sense that they don’t cause an error IE, they don’t seem to prevent caching 100% – there is a timeout. [...]

      7. JOS KOOMEN . FLASH DEVELOPER . BLOG . Flash loading bug in IE Says:

        [...] problem still exists in Internet Explorer 7! Don’t know about Vista… Here it’s suggested that “Cache-Control: must-revalidate” and “Cache-Control: max-age=0″ also [...]

      8. Mark Says:

        These work when using the maani xml charts – the swf file uses an xml file when displaying chart data.

        session_cache_limiter(‘public’);
        or:
        session_cache_limiter(‘public_no_cache’);

        if you’re building your own headers, add:

        header(‘Pragma: public’)
        or:
        header(‘Pragma: public_no_cache’)

      9. Marc Says:

        Thanks for the feedback, Mark. You are saying that it works with an SSL encrypted HTTP transmission? You also don’t use AMF0/AMF3 and you verified the presence of the headers on the client side, right?

      10. i0n Says:

        PHP inject ‘Pragma’ and ‘Cache-Control’ on the session_start(); function by default.

        To remove it, at easy way with
        header(“Pragma:”);

      11. Clayton Says:

        Thank you for the post. I too was wrestling with this issue. My chart data was not showing up in the microsoft browser IE 6 or 7. I played with a bunch of settings and tags. I finally come to a solution that worked good for me. My page does have a SSL connection.

        I embedded my movie with code like this. BAM works like a charm.

      12. Clayton Says:

        <!—

        —>

      13. Edgeman Says:

        Clayton, could you send me your code? I have the same problem with IE not showing flash charts, but Firefox works fine. Maybe if you could post your code somewhere else where it is not stripped out?? Thanks in advance!

      14. Marc Says:

        Hey Edgeman and Clayton, if you have a link or useful code, I’m happy to post it in the text where wordpress does not suppress it.

      15. Fix your Flex HTTP Error / Stream Error with IE6 / IE7 on HTTPS | Java Blog Says:

        [...] check out Jim Robson’s blog and Mark Speck’s blog for more research regarding this issue. Share and [...]

      16. Mark Guadagna Says:

        This is absolutely the fix for an issue that has plaqued us for a days now, just in IE, just under HTTPS, just with XML, as stated. Wow — thank you!

      17. Chris Barnes Says:

        Thankyou so much:

        ini_set(“session.cache_limiter”, “”);

        No I can use my Flex App in IE6.
        I had given up hope !

        All we need now is a fix for FileUpload under Firefox HTTPS.

        Top work !

        :-)

      18. Ben Says:

        Using:

        ini_set(”session.cache_limiter”, “”);

        is what helped my app to work! Thanks guys!

      19. jonathan Says:

        thank you :)

      20. Melissa Says:

        Hi there – I am still searching resolution. I see that ini_set is PHP specific. I have ASP under SSL which is causing the flash not to show.
        I tried Response.CacheControl=”no-store” … didn’t work. Is there something else I can try? Can you post the asp code?

        Thanks.

      21. Marc Says:

        Hi Melissa,
        I don’t know ASP, sorry.
        Marc

      22. Mike Says:

        I have the same problem as Melissa.

        I have a Flex web app which requests XML back from an ASPX page but changing the header cache-control to “no-store” makes the ASPX page falls over saying “no-store” is an invalid value…. did you (or anyone else) manage to work this out?

      23. Joao Says:

        You saved my project man… Thank you!!!

      24. Jamie Says:

        You are a lifesaver! Thanks for the detailed post.

      25. Jazza Says:

        CHEERS! You saved my ass!
        My flex app was loading XML via HTTPS. The following headers fixed IE7 and IE8:

        header (“Cache-Control: no-store,max-age=0,must-revalidate”);
        header (“Pragma: public”);
        header (“Pragma: public_no_cache”);
        header (“Content-Type: text/xml”);

      26. mko Says:

        Wow, what a life saver this post was…THANK YOU SO MUCH!

      27. sandrar Says:

        Hi! I was surfing and found your blog post… nice! I love your blog. :) Cheers! Sandra. R.

      Leave a Reply