summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Beaupré2009-11-23 12:39:05 -0500
committeranarcat2009-11-23 12:39:05 -0500
commitca2d3ae86bb1d694cfe69b0ac81ad3dedcbdc774 (patch)
tree3f5100e615dd555d683e77eefc94f1eb117d1baa
parentc1a08bdb06454054caf884feb1c3830a211459db (diff)
#537016 - add per-domain certificates, first draft for devseedssl
-rw-r--r--ssl/provision_ssl.drush.inc14
-rw-r--r--ssl/verify.provision.inc1
2 files changed, 14 insertions, 1 deletions
diff --git a/ssl/provision_ssl.drush.inc b/ssl/provision_ssl.drush.inc
index 01574ce..2c7ce1f 100644
--- a/ssl/provision_ssl.drush.inc
+++ b/ssl/provision_ssl.drush.inc
@@ -26,7 +26,19 @@ function provision_ssl_provision_apache_vhost_config($url, $options) {
$newoptions['site_port'] = 80;
_provision_apache_create_config($url . '_80', $newoptions, _provision_apache_redirect_template());
}
- return array("php_value session.cookie_secure 1", "SSLEngine On");
+ $lines = array("php_value session.cookie_secure 1", "SSLEngine On");
+ // we make sure it is set to keep default behaviour (ie. if unset,
+ // it is yes)
+ if (isset($options['ssl_wildcard']) && !$options['ssl_wildcard']) {
+ $ssl_dir = drush_get_option('config_path') . "/ssl.d/";
+ if (file_exists("$ssl_dir/$url.crt") && file_exists("$ssl_dir/$url.key")) {
+ $lines[] = "SSLCertificateFile " . "$ssl_dir/$url.crt";
+ $lines[] = "SSLCertificateKeyFile " . "$ssl_dir/$url.key";
+ } else {
+ drush_log(dt("cannot find SSL certificates %cert or %key, using server-wide wildcard", array('%cert' => "$ssl_dir/$url.crt", '%key' => "$ssl_dir/$url.key")));
+ }
+ }
+ return $lines;
} else {
return NULL;
}
diff --git a/ssl/verify.provision.inc b/ssl/verify.provision.inc
index 626eb34..66d541d 100644
--- a/ssl/verify.provision.inc
+++ b/ssl/verify.provision.inc
@@ -5,5 +5,6 @@
function drush_provision_ssl_post_provision_verify($url = NULL) {
if (PROVISION_CONTEXT_SITE) {
drush_set_option('ssl', drush_get_option('ssl'), 'site');
+ drush_set_option('ssl_wildcard', drush_get_option('ssl_wildcard'), 'site');
}
}