Last week week, I noticed a strange problem with a project I am working on. The SWF worked fine on XP, Linux, Vista, and OSX. It worked under Firefox, Opera, and Safari. It... loaded under IE7, and then just sort of sat there and pretended that the web services it was trying to call were broken. After poking things for a bit, I sent an email to the Flashcoders mailing list:

I have a swf that is being loaded off of an https server. As it fires up, it attempts to call a simple authentication service that lives on the same host. This works fine under Firefox, Opera, and Safari.

However, under IE, it throws an exception:

[IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: https://host/path/script.php?username=allaryin&passwd=hash"]

Obviously, if I just load the url directly into IE, it loads fine. This problem only occurs when flash tries to load the url for me.

When I monitor the query with Charles, it shows that the request is being made correctly and that the information I am expecting is successfully being returned. However, Flash is apparently ignoring the response.

This behavior has been observed on different machines, running both XP and Vista.

Thoughts?

A few days after sending this email, I'd received no response other than an IM from a friend on the list who didn't know the answer either. So... I resumed consultation of the Google. I dug through ML archives. I read IRC logs. Eventually, I stumbled across mention of a blog post back in 2005 that had addressed a similar problem under IE6. Unfortunately, the site hosting this old blog has ceased to exist/function. So, I found it on the Internet Archive:

http://web.archive.org/web/20070521185428/http://www.gmrweb.net/2005/08/18/flash-remoting-https-internet-explorer/

The post mentions a few potential solutions to the problem such as doing some http header management in Apache. I tried the suggested changes (in the PHP, I didn't have the access/desire to tweak Apache at the time):

header("Expires: " . date("D, d M Y H:i:s", 0) . " GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");

This didn't have any effect on my particular problem. Charles showed that the requested headers were being sent correctly, but Flash + IE7 + HTTPS still failed to talk to my web service.

So, I poked around the net some more without coming up with any helpful solutions to the problem. Returning to the archived blog post, I read the comments and saw another solution proposed. Someone said that simply sending an empty pragma header seemed to help in cases where IE was having difficulty dealing with PHP sessions over HTTPS. Specifically, the pragma header needed to be flushed after the session had started.

And we were using a session variable...

session_start();
header("Pragma: ");

And it works now.

So... yeah. Hooray for obscure comments on wayback machine archived blog posts addressing a similar problem ;)

Quick little annoyance that I need to gripe about.

I'm prone to beta testing software, since, well... that's what I do. As such, I've been running the IE7 beta ever since it launched and am using it right now to post this. I am impressed with the thoroughness with which Microsoft has stolen features from Firefox and Opera and I am happy that they finally offer decent PNG and CSS support (hooray for 10-year-old technologies).

It generally appears to have been a well thought out product - at least, it becomes a usable browser when compared to IE6. And they have absolutely no excuse not to have produced something just astronomically better than IE6. After all, it's been 5 years since they released a feature upgrade in their browser - which curiously accompanied all of the anti-trust fun.

That said, I'm expecting that they'll experience something like tremendous backlash when they start pushing the browser on unsuspecting lusers. The menu layout is borderline arcane. I'm looking as hard as I can, and cannot manage to find anything resembling a "File -> Open" menu option. Ok, I lied. By navigating to "Tools -> Toolbars -> Classic Menu", I was able to toggle this back on (don't remember if it is disabled by default or not).

So... I select Open because I want to open a locally stored file - jpeg comp of a site I'm working on. Since I have IE open for testing anyways, and since it offers tabbed browsing and all... I navigate to the directory in question and have to change the file type in the little box to jpeg (by default, they were displaying only html files in the dialog). The file becomes selectable and I tell it to open.

Which it does.

In GIMP.

Now, had I double-clicked on the icon in Windows Explorer, I would have expected to fire up GIMP. But I specifically told Internet Explorer to load the file... Of course, Microsoft swears up and down that they're separate products, and that your computer can function w/o IE...

URGH!

Upon further investigation (in IE6), it appears that this is IE's native behavior - that it refuses to display an image unless it is loaded from an html page. Using the open dialog in IE6 on another machine, we got the picture in question to load in the Windows Picture Viewer Thing.