Download with SSL

Any hacks and modifications will be in here...

Download with SSL

Postby gdave44 » Thu Mar 31, 2011 7:31 pm

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?
gdave44
Newbie Member
 
Posts: 2
Joined: Tue Mar 29, 2011 3:48 pm

Re: Download with SSL

Postby SamEA » Fri Apr 01, 2011 8:32 am

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.
SamEA,
DaddyScripts' Admin & Developer.

Require a PHP or general IT freelancer? Don't hesitate to PM me.
User avatar
SamEA
Site Admin
 
Posts: 1165
Joined: Sat Feb 19, 2011 7:51 pm

Re: Download with SSL

Postby gdave44 » Mon Apr 04, 2011 7:33 pm

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.
gdave44
Newbie Member
 
Posts: 2
Joined: Tue Mar 29, 2011 3:48 pm

Re: Download with SSL

Postby PeterS » Fri Apr 08, 2011 12:33 am

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.
PeterS
Global Moderator
 
Posts: 159
Joined: Mon Feb 21, 2011 4:58 am


Return to Hacks and Modifications

Who is online

Users browsing this forum: No registered users and 2 guests

cron