My initial experience with HTTPS Flash Remoting in Microsoft Internet Explorer was an absolute disaster! I was so frustrated as to why my remoting connection was working flawlessly in Mozilla Firefox and the MS Windows stand-alone Flash player, while not working at all in Internet Explorer. After hours of Google searches and digging through forum posts (which is probably where you are if you are reading this text), I decided to take matters into my own hands.
Let me preface my conclusion with a brief discussion on how Flash implements HTTP(S) connections. If your Flash application is loaded within a browser window, it actually uses the browser as an API of sorts for making HTTP(S) connections. If it is loaded within the stand-alone player, I am not certain, but I believe it uses a Flash specific browser built into that player.
Therefore, if connection problems are occurring only in Internet Explorer, then most likely it is a problem with either the communication with Flash and Internet Explorer, or Internet Explorer itself.
I have concluded that this problem is caused by the way that Internet Explorer handles the caching of HTTPS data. It appears as though Internet Explorer, if instructed to by the server, will cache all HTTP(S) data before giving it to Flash (if Flash initiated the request). For reasons that are unknown, the amount of time Internet Explorer takes to generate the cache on HTTPS data and hand it off to Flash causes Flash to timeout and fail on the connection. Therefore, this problem can be remedied by simply having your web server instruct browsers to not cache the HTTPS result for your remoting data.
There are many posts out there on how to disable caching. You can even use PHP and other scripting languages to output custom headers. However, I am confident that this solution is the easiest and most stable. Here are two simple steps that you can use to disable caching in Apache (1.x & 2):
- Install mod_headers. For those who are familiar with Apache modules, this should be a fairly easy step. Mod_headers is a very handy tool for generating custom headers for your web pages. (See http://httpd.apache.org/docs/1.3/mod/mod_headers.html for further info).
-
Place the following commands in your apache conf file or an .htaccess file within the scope of your remoting gateway:
Header unset "Expires"
Header unset "Pragma"
Header set "Cache-Control" "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
That’s it, you are done, and now IE can connect to your HTTPS remoting gateway with ease!
NOTE:
There is a security setting in Internet Explorer that can completely disable Flash Remoting over HTTPS. Users need to be certain that they have the following advanced security setting disabled for things to work properly.
Go to: “Tools� => “Internet Options� => Click on the “Advanced� tab. Make sure “Do not save encrypted pages to disk� is disabled or not checked.