The default server port is set to 80, causing error when SSL is used in Drupal.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

KelvinWong created an issue. See original summary.

KelvinWong’s picture

Added HTTPS check and set server port to 443 when HTTPS is used.

snufkin’s picture

Status: Needs review » Needs work

This is something that Drupal generally should be able to handle, I don't see why we need to manage this within the module itself. Are you handling SSL traffic after SSL termination on an LB layer?

cloris’s picture

I just hit this issue simplesamlphp 1.14 and simplesamlhttp_auth 7.2-3.x-dev and your patch worked well. After a little more research, it looks like the underlying issue for me was with simplesamlphp and my load balancers. See this discussion - https://github.com/simplesamlphp/simplesamlphp/issues/450#issuecomment-2.... If you terminate your SSL on a LB in front of Drupal, then the server thinks it is on port 80 but Drupal thinks it is using SSL. This is where the fun happens. It does not appear to be a simplesamlphp_auth issue.

aprohl5’s picture

This is not an issue with the module, but can be resolved by adding the following snippet to config.php in your simplesaml library. Possibly at a location such as /simplesamlphp-1.14.11/config/config.php in your git repo.

if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
$_SERVER['SERVER_PORT'] = 443;
$_SERVER['HTTPS'] = 'true';
}

I am closing this issue as the error is not with the module.

aprohl5’s picture

Status: Needs work » Closed (works as designed)