During Drupal's bootstrapping, if a $base_url is not specifically provided (i.e. settings.php), it will create it by referencing the $_SERVER superglobal.

// Create base URL
$base_root = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';

$base_url = $base_root .= '://'. $_SERVER['HTTP_HOST'];

When conf_init() is run, Drush sets some $_SERVER values. For instance, $_SERVER['HTTP_HOST'] is set according to the selected URI. However, it does not set $_SERVER['HTTPS'], so Drupal will construct the $base_url with "http" and not "https".

Most operations will not care about this difference of the URI scheme, however any absolute links created via Drupal's url() will use http. On of the cases we've noticed is in email notifications that get sent out. If Drush is used to send them out, then all the links are http, whereas they should be https.

Yes, you can override the $base_url in settings.php, but it seems like Drush should be handling this already (unless I'm not seeing some reason it shouldn't be).

CommentFileSizeAuthor
#1 server-https-1870580-1.patch486 byteskevin.dutra

Comments

kevin.dutra’s picture

Status: Active » Needs review
StatusFileSize
new486 bytes

Here's the patch I'd suggest.

moshe weitzman’s picture

Version: 7.x-5.8 »
Status: Needs review » Reviewed & tested by the community

Seems reasonable to me. Will leave open a couple days before committing.

moshe weitzman’s picture

Version: » 8.x-6.x-dev
Status: Reviewed & tested by the community » Fixed

Committed to 5.x and 6.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.