XUpload - Issues with SSL and IE

Message
Author
hanji
Posts: 36
Joined: Nov 10, 2006 3:33 am

Issues with SSL and IE

#1 Postby hanji » Dec 11, 2006 5:58 pm

Hello

This problem just came up.. so I'm concerned it's a service pack or windows update issue. Just recently, my XUpload application is not behaving correctly when users access the application with IE and hit port 443.

My app uses inline progress bar. The file no matter what get's uploaded to the server, but the progress bar stops around 2-5% and "hangs". Then a message in the status window will say "Upload Failed". But actually the upload is still progressing in the background. It almost seems like the upload_status.cgi is unreachable after the first request.

This works perfectly with Firefox. I've tested with multiple servers, and it is reproducable on all.

My IE version:
6.0.2900.2180.xpsp_sp2_gdr.050301-1519
Updated Version:; SP2;

Here is the screen shot of the progress + error

Image

Again, like to state that this works fine in Firefox (also tested with Opera on Windows). This use to work until recently. This is reproducable on multiple (three servers) when uploading with SSL. I can also confirm that this happens with multiple users (2 using IE6 and 1 using IE7). No code changes have been made.

My version of XUpload:
XUploadPro-2.3

Any help is greatly appreciated!

Thanks!
hanji
Last edited by hanji on Dec 11, 2006 8:10 pm, edited 1 time in total.

hanji
Posts: 36
Joined: Nov 10, 2006 3:33 am

#2 Postby hanji » Dec 11, 2006 8:09 pm

This seems to happen on certain files (probably related to filesize). All my tests that failed were using the following file:

http://www.uno-code.com/images/59_LP.jpg

This is 1.11MB. Every one of my IE tests will hang and the progress stops. But when I tried to upload a 400k file it worked. I pushed that up to 600k and it failed as well.

Additional testing shows that this is intermittent.. progress bar might fail if you try uploading a previously successful file.

Here is an example of XUpload running on my local network connecting to my development server over SSL. This file is 182MB large (well within max), and you can see where it 'stalls' and picks backup. then eventually ends with "Upload failed!". The file will upload though. I've verified that file is in /temp and is moved to /uploads.

Image

Sorry to keep reporting, but wanted to give as much information as possible since the problem needs to get fixed.

Thanks!
hanji

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#3 Postby PilgrimX182 » Dec 12, 2006 6:59 am

Strange new problem. Looks browser-related.
Please PM me the URL to upload form and maybe FTP/SSH access to script. Will make some test/debug.

hanji
Posts: 36
Joined: Nov 10, 2006 3:33 am

#4 Postby hanji » Dec 18, 2006 5:47 pm

Ok.. I have things more or less isolated now. I know you weren't able to reproduce this, but it's reproduceable by countless users using this app on my end.

Here is what I know is related to the problem.

- It appears that IE6 XP SP2 is affected.
- problem occured after updates (kb925454 kb923689 kb926255)
- most likely related to MS06-067 http://support.microsoft.com/?kbid=922760
- this is related to how IE transmits the stream to the upload.cgi in SSL and IE6

Removing XUpload out of the picture and using straight PHP, the file is streamed to /tmp at a normal rate. So, it doesn't appear it has anything to do with IE6 and Apache/SSL. As soon as I include XUpload, the stream has a tendency to hang or pause in /temp. Again, this only happens in HTTPS and IE. This cancels out the server configuration (ie: how /temp was set, etc), but I think it's related to something with perl and SSL possibly.

For now, we had to remove XUpload from our application since we were flooded with complaints. I also noticed that servers with IE6 seem to work. We tested on three Windows2003 servers with IE6 and they all worked fine.

We replicated this problem in a controlled environment using vmware images with XP SP2 installs, and slowly upgraded them. As we upgraded, we tested to see if the problem exists. As soon as we hit the (kb925454 kb923689 kb926255) upgrades, we saw the problem.

Any help is greatly appreciated.

Thanks!
hanji

hanji
Posts: 36
Joined: Nov 10, 2006 3:33 am

#5 Postby hanji » Dec 19, 2006 2:58 pm

Is there any debug statements or tests I can put in upload.cgi? It definitely appears to be related to how perl handles the filestream from IE6 in SSL.

My versions of apache and perl are the following:
apache-2.0.58-r2
perl-5.8.8-r2

Any help is greatly appreciated.

hanji

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#6 Postby PilgrimX182 » Dec 20, 2006 7:18 am

Possible trick: update perl CGI module using shell command 'perl -MCPAN -e shell' then 'install CGI'

OR

Put CGI.pm from http://search.cpan.org/src/LDS/CGI.pm-3.25/ to the same folder where upload.cgi is.

In changelog there's recent fix about browser hangs, maybe will help.

Also try to update mod_ssl if possible.

Also set Full URL to upload.cgi in upload_form.html

Also try to comment directives inside .htaccess, maybe they affect somehow.

No more ideas at the moment.

hanji
Posts: 36
Joined: Nov 10, 2006 3:33 am

#7 Postby hanji » Dec 20, 2006 7:31 am

Interesting, I'm running CGI-3.15 on all servers. I'll upgrade to 3.25 in the morning.

Thanks!
hanji

hanji
Posts: 36
Joined: Nov 10, 2006 3:33 am

#8 Postby hanji » Dec 20, 2006 5:48 pm

PilgrimX182

First off, I want to say thanks for the help. I know this is a tough problem. I'm leaning towards that it's either upload.cgi or upload_status.cgi that is having the problem.

I upgraded my CGI.pm to 3.25 (originally had 3.15). This did not correct the problem. I then wrote a simple perl script to process an upload file to see if the problem is how CGI handles the traffic between my browser and SSL.. and guess what, it worked with out a problem.

Code: Select all

#!/usr/bin/perl

use CGI;
print "Content-type: text/html\n\n";
$upload_dir = "/tmp";
$query = new CGI;
$filename = $query->param("UploadFile");
$filename =~ s/.*[\/\\](.*)/$1/;
$upload_filehandle = $query->upload("UploadFile");
open UPLOADFILE, ">$upload_dir/$filename";
binmode UPLOADFILE;
while ( <$upload_filehandle> )
{
        print UPLOADFILE;
}
close UPLOADFILE;
print "DONE";
Also, looking at the XUpload behaviour, it seem to act choppy or hang, UNTIL the progress bar says "Upload Failed". After that the transfer works as expected.

So my findings.

- I don't think it's related to CGI.pm
- Simple perl script upload_test.cgi works with IE and SSL
- Transfer is steady after status reports failure

I hope this helps. Let me know if you need access to my test environment.

Thanks!
hanji

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#9 Postby PilgrimX182 » Dec 21, 2006 7:33 am

A bit confused. What do you mean "it worked with out a problem", you said XUpload upload too, but with delay, don't this simple script have this delay?

Also, looking at the XUpload behaviour, it seem to act choppy or hang, UNTIL the progress bar says "Upload Failed". After that the transfer works as expected.
So when you don't open progress bar window does it works fine or still problem? Need to be sured that progress bar involved in problem or not.

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#10 Postby PilgrimX182 » Dec 21, 2006 7:48 am

Also try to comment this line:

Code: Select all

$CGI::POST_MAX = 1024 * $c->{max_upload_size};   # set max Total upload size

hanji
Posts: 36
Joined: Nov 10, 2006 3:33 am

#11 Postby hanji » Dec 21, 2006 3:06 pm

The simple script works without a delay or pause. The upload stream is steady and fast via IE and SSL.

Is there a way to turn off the progress portion of XUpload for testing?

I'll try your suggestion in a bit and will report back.

Thanks!
hanji

hanji
Posts: 36
Joined: Nov 10, 2006 3:33 am

#12 Postby hanji » Dec 21, 2006 3:42 pm

PilgrimX182 wrote:Also try to comment this line:

Code: Select all

$CGI::POST_MAX = 1024 * $c->{max_upload_size};   # set max Total upload size
I commented this line and the problem is still there. Did you ever update your Windows machine and try my test application again? I even had friends totally not related to this project try my test app with their updated IE, and it happens to them.

hanji

hanji
Posts: 36
Joined: Nov 10, 2006 3:33 am

#13 Postby hanji » Dec 21, 2006 5:49 pm

PilgrimX182 wrote: Also set Full URL to upload.cgi in upload_form.html

Also try to comment directives inside .htaccess, maybe they affect somehow.
I tried both of those (URL was already full path)... no change. I'm almost 100% positive it's related to upload_status.cgi. I think it stalls the browser. When it dies, the upload works fine in SSL.

If you know of a way to bypass that for testing, let me know.. at least we'd be able to isolate the problem.

hanji
Last edited by hanji on Dec 21, 2006 6:02 pm, edited 1 time in total.

hanji
Posts: 36
Joined: Nov 10, 2006 3:33 am

#14 Postby hanji » Dec 21, 2006 5:57 pm

I changed inline to 0 and the upload works without pausing. It looks like it's totally related to the inline progress bar.

hanji

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#15 Postby PilgrimX182 » Dec 22, 2006 12:03 pm

I changed inline to 0 and the upload works without pausing. It looks like it's totally related to the inline progress bar.
Aha! That's better now. So it looks like IE can't handle 2 simultaneous SSL connections.

So try this...in xupload.js replace

Code: Select all

self.transfer2.document.location = cgi_url+'?inline=1&upload_id='+UID+'&num_files='+NF+'&css_name='+f1.css_name.value+'&tmpl_name='+f1.tmpl_name.value+'&xmode='+f1.xmode.value;
with

Code: Select all

url=cgi_url+'?inline=1&upload_id='+UID+'&num_files='+NF+'&css_name='+f1.css_name.value+'&tmpl_name='+f1.tmpl_name.value+'&xmode='+f1.xmode.value;
setTimeout("self.transfer2.document.location = '"+url+"'",2000);
this will delay opening progress bar, maybe will help, maybe will just let upload file for 2 seconds, then stuck.[/code]