Ticket #1486091 (closed Patches: fixed)

Opened 12 months ago

Last modified 11 months ago

Option to specify the HTTPS port

Reported by: lex Owned by:
Priority: 5 Milestone: 0.3.1
Component: Other Version: 0.3-stable
Severity: normal Keywords:
Cc:

Description

I've created a patch that allows the administrator to specify the port used for HTTPS connections, as not everyone is using port 443 for this.

Attachments

rc_https_port.patch (0.9 KB) - added by lex 12 months ago.

Change History

  Changed 12 months ago by lex

Add the following to the main.inc.php file to use it:

// set the port used for https connections
$rcmail_config['https_port'] = 443;

follow-up: ↓ 3   Changed 12 months ago by blodan

hm, the included patch isnt 100%, you probably dont want to redirect to https://yourhost.com:443, as thats the default port so https://yourhost.com would suffice :P

header('Location: https://' . $_SERVER['HTTP_HOST'] . ($RCMAIL->config->get('https_port') != 443 ? ":" . $RCMAIL->config->get('https_port') : '') . $_SERVER['REQUEST_URI']); 

should do it :)

Changed 12 months ago by lex

in reply to: ↑ 2   Changed 12 months ago by lex

Replying to blodan:

hm, the included patch isnt 100%, you probably dont want to redirect to https://yourhost.com:443, as thats the default port so https://yourhost.com would suffice :P {{{ header('Location: https://' . $_SERVERHTTP_HOST? . ($RCMAIL->config->get('https_port') != 443 ? ":" . $RCMAIL->config->get('https_port') : ) . $_SERVERREQUEST_URI?); }}} should do it :)

Most browsers will get rid of the :443 themselves (and it won't cause any troubles if it doesn't), but you are right, your solution is cleaner, I have updated the patch.

  Changed 11 months ago by alec

  • status changed from new to closed
  • resolution set to fixed

Implemented with 'force_https' plugin in r3038.

  Changed 11 months ago by thomasb

Please sorry for the confusion but we now decided to keep the force_https config option for compatibility reasons but instead of adding a new option you can now specify the port number as a value of force_https itself. If it is just set to true, the default port 443 is assumed. Changes committed in r3049

Note: See TracTickets for help on using tickets.