Commit 61cc6e25 authored by anarcat's avatar anarcat

Merge branch 'dev-ssl-ip-allocation-refactor' into 6.x-2.x

parents c07f2558 2b41934a
......@@ -38,7 +38,7 @@ class Provision_Service_http_ssl extends Provision_Service_http_public {
$this->context->setProperty('ssl_enabled', 0);
$this->context->setProperty('ssl_key', NULL);
$this->context->setProperty('ip_address', '*');
$this->context->setProperty('ip_addresses', array());
}
......@@ -47,7 +47,16 @@ class Provision_Service_http_ssl extends Provision_Service_http_public {
$data['http_ssl_port'] = $this->server->http_ssl_port;
if ($config == 'site' && $this->context->ssl_enabled) {
$data['ip_address'] = $this->context->ip_address;
foreach ($this->context->ip_addresses as $server => $ip_address) {
if ($this->server->name == '@' . $server) {
$data['ip_address'] = $ip_address;
break;
}
}
if (!isset($data['ip_address'])) {
drush_log(dt('No proper IP provided by the frontend for server %servername, using wildcard', array('%servername' => $this->server->name)), 'warning');
$data['ip_address'] = '*';
}
if ($this->context->ssl_enabled == 2) {
$data['ssl_redirection'] = TRUE;
$data['redirect_url'] = "https://{$this->context->uri}";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment