Make WordPress Core

Opened 14 years ago

Closed 8 years ago

#16167 closed defect (bug) (wontfix)

FORCE_ADMIN_SSL broken if site runs on port different from 80

Reported by: yoush's profile yoush Owned by: johnbillion's profile johnbillion
Milestone: Priority: normal
Severity: normal Version: 2.6
Component: Bootstrap/Load Keywords: has-patch needs-unit-tests needs-testing needs-refresh https
Focuses: Cc:

Description

I'm running a wordpress site (http://yoush.homelinux.org:8079/) hosted at my home server. Unfortunately mu ISP blocks incoming connections on port 80, so I have to use non-standard port.

With unmodified wordpress 3.0.4, I was unable to use FORCE_ADMIN_SSL, because it caused URLs starting with

http://yoush.homelinux.org:8079/

to be converted to

https://yoush.homelinux.org:8079/

Which is definitly broken since it is impossible to serve both http and https on the same port.

To fix this, I propose removing ':port' from URL when converting http url to https.
I've created a patch for this, that seems to work for me on my site.

Attachments (2)

When-converting-http-url-to-https-url-remove-port.patch (5.0 KB) - added by yoush 14 years ago.
Patch that fixes this issue for me
16167.patch (8.9 KB) - added by kurtpayne 13 years ago.
Allow WP_HTTP_PORT and WP_HTTPS_PORT config values

Download all attachments as: .zip

Change History (12)

@yoush
14 years ago

Patch that fixes this issue for me

#1 @mdawaffe
14 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

Another idea would be to create two new constants WP_PORT_HTTP and WP_PORT_HTTPS or something and append them to the domain during that redirect (if they're not 80, 443 respectively).

Speaking as a former I-host-my-blog-on-a-non-standard-port WordPress user myself, I can sympathize :)

#2 @joh6nn
13 years ago

  • Keywords has-patch added; needs-patch removed

@kurtpayne
13 years ago

Allow WP_HTTP_PORT and WP_HTTPS_PORT config values

#3 @kurtpayne
13 years ago

  • Cc kpayne@… added

To use this 16167.patch, create new constants in your wp-config.php file like so:

define('WP_HTTP_PORT', 81);
define('WP_HTTPS_PORT', 444);

Then you should be able to login / admin on over SSL on port 444, but browse content over port 81. There's two new functions for themes / plugins, too, to convert between URLs between http / https:

make_https($url);
make_http($url);

#4 @nacin
11 years ago

  • Component changed from General to Bootstrap/Load

#5 @chriscct7
9 years ago

  • Keywords needs-refresh added

Also has some formatting issues

#6 @johnbillion
9 years ago

  • Keywords needs-unit-tests needs-testing added; needs-refresh removed
  • Milestone changed from Future Release to Awaiting Review
  • Owner set to johnbillion
  • Status changed from new to reviewing
  • Version changed from 3.0.4 to 2.6

#7 @johnbillion
9 years ago

  • Keywords needs-refresh added

#8 @johnbillion
9 years ago

  • Keywords https added

This ticket was mentioned in Slack in #core-http by johnbillion. View the logs.


8 years ago

#10 @johnbillion
8 years ago

  • Keywords changed from has-patch, needs-unit-tests, needs-testing, needs-refresh, https to has-patch needs-unit-tests needs-testing needs-refresh https
  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from reviewing to closed

This ticket doesn't have much chance of going anywhere because of the rare configuration, so I'm closing it as wontfix. Unfortunately, core can't handle every possible configuration of hosts, ports, and schemes, and this is one such configuration that isn't going to get much love.

The recommendation here is to use the home_url and admin_url filters as necessary to correct the port and scheme as appropriate for your site.

Note: See TracTickets for help on using tickets.