Make WordPress Core

Opened 16 years ago

Closed 10 years ago

#16167 closed defect (bug) (wontfix)

FORCE_ADMIN_SSL broken if site runs on port different from 80

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

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 16 years ago.
Patch that fixes this issue for me
16167.patch (8.9 KB ) - added by kurtpayne 15 years ago.
Allow WP_HTTP_PORT and WP_HTTPS_PORT config values

Download all attachments as: .zip

Change History (12)

@yoush
16 years ago

Patch that fixes this issue for me

#1 @mdawaffe
16 years ago

  • Keywords needs-patch added
  • Milestone Awaiting ReviewFuture 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
15 years ago

  • Keywords has-patch added; needs-patch removed

@kurtpayne
15 years ago

Allow WP_HTTP_PORT and WP_HTTPS_PORT config values

#3 @kurtpayne
15 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
13 years ago

  • Component GeneralBootstrap/Load

#5 @chriscct7
11 years ago

  • Keywords needs-refresh added

Also has some formatting issues

#6 @johnbillion
11 years ago

  • Keywords needs-unit-tests needs-testing added; needs-refresh removed
  • Milestone Future ReleaseAwaiting Review
  • Owner set to johnbillion
  • Status newreviewing
  • Version 3.0.42.6

#7 @johnbillion
11 years ago

  • Keywords needs-refresh added

#8 @johnbillion
11 years ago

  • Keywords https added

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


10 years ago

#10 @johnbillion
10 years ago

  • Keywords has-patch, needs-unit-tests, needs-testing, needs-refresh, https → has-patch needs-unit-tests needs-testing needs-refresh https
  • Milestone Awaiting Review
  • Resolutionwontfix
  • Status reviewingclosed

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.