SSL & invain redirection to domain with :80 added

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
steve59
Registered User
Posts: 53
Joined: Mon Jun 01, 2015 9:32 am

SSL & invain redirection to domain with :80 added

Post by steve59 » Mon Dec 04, 2017 4:37 pm

Dear reader,

Our web hosting provider serves SSL via port 80.

Now when someone posts on our forum (version 3.2.1), they first get the message that their post needs approval,
which is correct (read we wanted that)
Next, after approx. 10 seconds, an automatic redirection follows

The problem is, that this redirection address containts :80 in de web address
after the domein name. This causes endless waiting, followed by an error

When I copy the link and remove :80 from it, the address is ok

This question I asked before about problems when entering the ACP might be related:
viewtopic.php?f=556&t=2448856

Best regards
Steve

User avatar
thecoalman
Former Team Member
Posts: 2333
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: SSL & invain redirection to domain with :80 added

Post by thecoalman » Mon Dec 04, 2017 4:47 pm

Do you have "Force server URL settings:" set to yes?

steve59
Registered User
Posts: 53
Joined: Mon Jun 01, 2015 9:32 am

Re: SSL & invain redirection to domain with :80 added

Post by steve59 » Mon Dec 04, 2017 5:11 pm

Do you have "Force server URL settings:" set to yes?
Hello thecoalman,
I changed this to "yes".

Now the redirect seems to be to the correct URL first
(with the message establishing SSL connection)
and then :80 is added again and connection fails

Copying and pasting the URL without :80 then gives the correct
forumpage

steve59
Registered User
Posts: 53
Joined: Mon Jun 01, 2015 9:32 am

Re: SSL & invain redirection to domain with :80 added

Post by steve59 » Mon Dec 04, 2017 7:28 pm

I found a "solution":

When I force the server port in phpbb (via the ACP panel) to 443,
then the problem goes away

Also this related issue seems to be "solved" then:
viewtopic.php?f=556&t=2448856

However, 443 is not the correct port, our provider uses port 80
for https (SSL)!

So before we apply this, we would like to know why (and how) this works
(since we don't want to create bigger problems elsewhere in phpbb or on other parts of our site - like redirect loops)

Steve

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 47990
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: SSL & invain redirection to domain with :80 added

Post by stevemaury » Mon Dec 04, 2017 7:41 pm

I would ask the host.
For REALLY good and VERY inexpensive hosting CLICK HERE

All unsolicited PMs will be ignored.

User avatar
thecoalman
Former Team Member
Posts: 2333
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: SSL & invain redirection to domain with :80 added

Post by thecoalman » Mon Dec 04, 2017 10:52 pm

steve59 wrote:
Mon Dec 04, 2017 5:11 pm
Do you have "Force server URL settings:" set to yes?
Hello thecoalman,
I changed this to "yes".
I guess I should of been a little clearer, if it was already set to yes it could cause the port to be appended with the port.

User avatar
thecoalman
Former Team Member
Posts: 2333
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: SSL & invain redirection to domain with :80 added

Post by thecoalman » Mon Dec 04, 2017 10:54 pm

steve59 wrote:
Mon Dec 04, 2017 7:28 pm
However, 443 is not the correct port, our provider uses port 80
for https (SSL)!
443 is common port for SSL....

steve59
Registered User
Posts: 53
Joined: Mon Jun 01, 2015 9:32 am

Re: SSL & invain redirection to domain with :80 added

Post by steve59 » Tue Dec 05, 2017 8:17 am

We came a bit further!

First we resetted (in ACP) "Force server URL settings" to "no" (to make phpbb able to choose the server port by itself),
and we resetted (in ACP) the server port setting to 80 (which is in our case the correct port although we use https protocol /SSL)

Next we found out that our problem is generated bij this code in function generate_board_url (in include/functions.php)

------------
if ($server_port && (($cookie_secure && $server_port <> 443) || (!$cookie_secure && $server_port <> 80)))
{
// HTTP HOST can carry a port number (we fetch $user->host, but for old versions this may be true)
if (strpos($server_name, ':') === false)
{
$url .= ':' . $server_port;
}
}
------------

Next, we disabled this piece of code

This seems to solve our problem.

However, is this a correct solution? Or can it create problems we are not aware of?
Steve

User avatar
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 23722
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: SSL & invain redirection to domain with :80 added

Post by Paul » Tue Dec 05, 2017 12:11 pm

The correct solution is to tell your host to follow standard and use 443 for SSL traffic.
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

steve59
Registered User
Posts: 53
Joined: Mon Jun 01, 2015 9:32 am

Re: SSL & invain redirection to domain with :80 added

Post by steve59 » Thu Dec 07, 2017 12:47 pm

We contacted our host. In contrast of what they said earlier, they use port 443 for our https-pages.
However, they serve those pages indirectly. This was the reason that we seemed to detect 80 as port.

We solved this problem bij setting the port to 443 in the phpbb-software,
and we set "force server URL settings" to "yes".
Until now this solution works, without having to change anything in the phpbb-code
(so we're back to standard code now)

Post Reply

Return to “[3.2.x] Support Forum”

Who is online

Users browsing this forum: bonelifer, Crizzo, david63, Sogou [Spider], xxx777 and 140 guests

cron