Page 1 of 1

Download with SSL

PostPosted: Thu Mar 31, 2011 7:31 pm
by gdave44
I'm attempting to make this work with SSL and port 4443 (as opposed to 443) and running into a few snags.

Uploads 'just worked' out of the box. GREAT! Downloads are giving me grief.
I updated download.php as follows
where there was just one $link file, I've replaced the line with...
if ($_SERVER["HTTPS"] == "on")
$link = "https:// . $_SERVER["HTTP_HOST"] . $_SERVER["PHP_SELF"] . $foo;
else
$link = "http:// . $_SERVER["HTTP_HOST"] . $_SERVER["PHP_SELF"] . $foo;

I don't have a quick and easy way to find out if this change will still work on normal setups, but, at least, now the dl/*.db files are written with the correct link in them. However, downloads are still failing. Any ideas where else the system may have http:// or a port number hard coded?

Re: Download with SSL

PostPosted: Fri Apr 01, 2011 8:32 am
by SamEA
gdave44 wrote:I'm attempting to make this work with SSL and port 4443 (as opposed to 443) and running into a few snags.

Uploads 'just worked' out of the box. GREAT! Downloads are giving me grief.
I updated download.php as follows
where there was just one $link file, I've replaced the line with...
if ($_SERVER["HTTPS"] == "on")
$link = "https:// . $_SERVER["HTTP_HOST"] . $_SERVER["PHP_SELF"] . $foo;
else
$link = "http:// . $_SERVER["HTTP_HOST"] . $_SERVER["PHP_SELF"] . $foo;
I don't have a quick and easy way to find out if this change will still work on normal setups, but, at least, now the dl/*.db files are written with the correct link in them. However, downloads are still failing. Any ideas where else the system may have http:// or a port number hard coded?


Instead of going through all of this hassle, why don't you just force .htaccess to SSL all connections where DFH is located, that should automatically change http to https.

This topic is more of a support topic than it is a MOD and so this topic shall soon be moved to the support section. Only finished mods should be posted here and please keep that in mind for the future.

Re: Download with SSL

PostPosted: Mon Apr 04, 2011 7:33 pm
by gdave44
I had a requirement to not interact with port 443 and port 80 is blocked at the firewall.

However, I did find the issue preventing my downloads. I'm not sure how it applies to SSL, and I'm surprised it doesn't show up in general.
In download2.php the line:
session_cache_limiter('none');
added before:
session_start();

cleared up my problem completely. Now I'm completely working over SSL both upload and download.

Re: Download with SSL

PostPosted: Fri Apr 08, 2011 12:33 am
by PeterS
gdave44 wrote:I had a requirement to not interact with port 443 and port 80 is blocked at the firewall.

However, I did find the issue preventing my downloads. I'm not sure how it applies to SSL, and I'm surprised it doesn't show up in general.
In download2.php the line:
session_cache_limiter('none');
added before:
session_start();

cleared up my problem completely. Now I'm completely working over SSL both upload and download.


Glad you solved your problem and thanks for sharing the above solution to the community.