diff --git a/modules/hosting/site/hosting_site.install b/modules/hosting/site/hosting_site.install
index cff1522..82ed988 100644
--- a/modules/hosting/site/hosting_site.install
+++ b/modules/hosting/site/hosting_site.install
@@ -74,6 +74,20 @@ function hosting_site_schema() {
         'type' => 'int',
         'not null' => TRUE,
       ),
+      'ssl_wildcard' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+      ),
+      'site_certificate_file' => array(
+        'type' => 'text',
+        'size' => 'big',
+        'not null' => FALSE,
+      ),
+      'site_certificate_key' => array(
+        'type' => 'text',
+        'size' => 'big',
+        'not null' => FALSE,
+      ),
     ),
     'primary key' => array('vid'),
   );
@@ -243,3 +257,13 @@ function hosting_site_update_6004() {
   return array();
 }
 
+/**
+ * Add ssl_wildcard column to hosting_site table
+ */
+function hosting_site_update_6005() {
+  $ret = array();
+  $ret[] = update_sql("ALTER TABLE {hosting_site} ADD COLUMN ssl_wildcard int NOT NULL default 0");
+  $ret[] = update_sql("ALTER TABLE {hosting_site} ADD COLUMN site_certificate_file longtext NOT NULL default ''");
+  $ret[] = update_sql("ALTER TABLE {hosting_site} ADD COLUMN site_certificate_key longtext NOT NULL default ''");
+  return $ret;
+}
diff --git a/modules/hosting/site/hosting_site.module b/modules/hosting/site/hosting_site.module
index 56a21fe..81af1a7 100644
--- a/modules/hosting/site/hosting_site.module
+++ b/modules/hosting/site/hosting_site.module
@@ -467,8 +467,9 @@ function hosting_site_insert(&$node) {
   $node->client = $client->nid;
   $node->site_language = ($node->site_language) ? $node->site_language : 'en';
 
-  db_query("INSERT INTO {hosting_site} (vid, nid, client, db_server, platform, profile, language, last_cron, status, verified, port, `ssl`, ssl_redirect) VALUES (%d, %d, %d, %d, %d, %d, '%s', %d, %d, %d, %d, %d, %d)",
-           $node->vid, $node->nid, $node->client, $node->db_server, $node->platform, $node->profile, $node->site_language, $node->last_cron, $node->site_status, $node->verified, $node->port, $node->ssl, $node->ssl_redirect);
+  db_query("INSERT INTO {hosting_site} (vid, nid, client, db_server, platform, profile, language, last_cron, status, verified, port, `ssl`, ssl_redirect, ssl_wildcard, site_certificate_file, site_certificate_key) VALUES (%d, %d, %d, %d, %d, %d, '%s', %d, %d, %d, %d, %d, %d, %d, '%s', '%s')",
+          $node->vid, $node->nid, $node->client, $node->db_server, $node->platform, $node->profile, $node->site_language, $node->last_cron, $node->site_status, $node->verified, $node->port, $node->ssl, $node->ssl_redirect, $node->ssl_wildcard, $node->site_certificate_file, $node->site_certificate_key);
+  
   if ((!$node->old_vid)) {
     if ($node->import) {
       hosting_add_task($node->nid, 'import');
@@ -506,8 +507,9 @@ function hosting_site_update(&$node) {
   else {
     $client = hosting_get_client($node->client);
     $node->client = $client->nid;
-    db_query("UPDATE {hosting_site} SET client = %d, db_server = %d, platform = %d, last_cron = %d, status = %d, profile = %d, language = '%s', verified = %d, port = %d, `ssl` = %d, ssl_redirect = %d WHERE vid=%d",
-             $node->client, $node->db_server, $node->platform, $node->last_cron, $node->site_status, $node->profile, $node->site_language, $node->verified, $node->port, $node->ssl, $node->ssl_redirect, $node->vid);
+    db_query("UPDATE {hosting_site} SET client = %d, db_server = %d, platform = %d, last_cron = %d, status = %d, profile = %d, language = '%s', verified = %d, port = %d, `ssl` = %d, ssl_redirect = %d, ssl_wildcard = %d, site_certificate_file = '%s', site_certificate_key = '%s' WHERE vid=%d",
+             $node->client, $node->db_server, $node->platform, $node->last_cron, $node->site_status, $node->profile, $node->site_language, $node->verified, $node->port, $node->ssl, $node->ssl_redirect, $node->ssl_wildcard, $node->site_certificate_file, $node->site_certificate_key, $node->vid);
+
   }
   if (!$node->no_verify) {
     hosting_add_task($node->nid, 'verify');
@@ -518,7 +520,7 @@ function hosting_site_update(&$node) {
  * Implementation of hook_load().
  */
 function hosting_site_load($node) {
-  $additions = db_fetch_object(db_query('SELECT  client, db_server, platform, profile, language as site_language, last_cron, status AS site_status, verified, port, `ssl`, ssl_redirect FROM {hosting_site} WHERE vid = %d', $node->vid));
+  $additions = db_fetch_object(db_query('SELECT  client, db_server, platform, profile, language as site_language, last_cron, status AS site_status, verified, port, `ssl`, ssl_redirect, ssl_wildcard, site_certificate_file, site_certificate_key FROM {hosting_site} WHERE vid = %d', $node->vid));
   return $additions;
 }
 
diff --git a/modules/hosting/ssl/hosting_ssl.drush.inc b/modules/hosting/ssl/hosting_ssl.drush.inc
index bbfe3bf..827a304 100644
--- a/modules/hosting/ssl/hosting_ssl.drush.inc
+++ b/modules/hosting/ssl/hosting_ssl.drush.inc
@@ -10,5 +10,8 @@ function drush_hosting_ssl_pre_hosting_task($task) {
   if ($task->ref->type == 'site') {
     $task->options['ssl'] = $task->ref->ssl;
     $task->options['ssl_redirect'] = $task->ref->ssl_redirect;
+    $task->options['ssl_wildcard'] = $task->ref->ssl_wildcard;
+    $task->options['site_certificate_file'] = $task->ref->site_certificate_file;
+    $task->options['site_certificate_key'] = $task->ref->site_certificate_key;
   }
 }
diff --git a/modules/hosting/ssl/hosting_ssl.module b/modules/hosting/ssl/hosting_ssl.module
index 049ebb9..d19e554 100644
--- a/modules/hosting/ssl/hosting_ssl.module
+++ b/modules/hosting/ssl/hosting_ssl.module
@@ -7,8 +7,11 @@
 
 function hosting_ssl_form_alter(&$form, &$form_state, $form_id) {
   if ($form_id == 'site_node_form') {
-    $form['port']['ssl'] = array('#type' => 'checkbox', '#title' => 'Enable SSL encryption', '#default_value' => $form['#node']->ssl, '#weight' => 4, '#attributes' => array('onClick' => 'if (!this.checked) { $("#edit-ssl-redirect").attr("checked", this.checked) };'),);
+    $form['port']['ssl'] = array('#type' => 'checkbox', '#title' => 'Enable SSL encryption', '#default_value' => $form['#node']->ssl, '#weight' => 4, '#attributes' => array('onClick' => 'if (!this.checked) { $("#edit-ssl-redirect, #edit-ssl-wildcard").attr("checked", this.checked) };'),);
     $form['port']['ssl_redirect'] = array('#type' => 'checkbox', '#title' => 'Redirect HTTP to HTTPS', '#default_value' => $form['#node']->ssl_redirect, '#weight' => 5, '#attributes' => array('onClick' => 'if (this.checked) { $("#edit-ssl").attr("checked", this.checked);}'),);
+    $form['port']['ssl_wildcard'] = array('#type' => 'checkbox', '#title' => 'Use server-wide certificate', '#default_value' => $form['#node']->ssl_wildcard, '#description' => t('If checked, a server-wide certificate will be used, otherwise the site-specific certificates will be used.'), '#weight' => 6);
+    $form['port']['site_certificate_file'] = array('#type' => 'textfield', '#title' => 'Site certificate file', '#default_value' => $form['#node']->site_certificate_file, '#description' => t('Absolute path of site-specific certificate file.'), '#weight' => 7);
+    $form['port']['site_certificate_key'] = array('#type' => 'textfield', '#title' => 'Site certificate key file', '#default_value' => $form['#node']->site_certificate_key, '#description' => t('Absolute path of site-specific certificate key file.'), '#weight' => 8);
     $form['port']['#title'] = t("Port and encryption");
   }
 }
diff --git a/modules/hosting/web_server/hosting_web_server.install b/modules/hosting/web_server/hosting_web_server.install
index 4b9cfc0..8389041 100644
--- a/modules/hosting/web_server/hosting_web_server.install
+++ b/modules/hosting/web_server/hosting_web_server.install
@@ -35,6 +35,16 @@ function hosting_web_server_schema() {
         'size' => 'big',
         'not null' => FALSE,
       ),
+      'server_certificate_file' => array(
+        'type' => 'text',
+        'size' => 'big',
+        'not null' => FALSE,
+      ),
+      'server_certificate_key' => array(
+        'type' => 'text',
+        'size' => 'big',
+        'not null' => FALSE,
+      ),
     ),
     'primary key' => array('vid'),
   );
@@ -85,3 +95,9 @@ function hosting_web_server_update_6000() {
   return $ret;
 }
 
+function hosting_web_server_update_6001() {
+  $ret = array();
+  $ret[] = update_sql("ALTER TABLE {hosting_web_server} ADD COLUMN server_certificate_file longtext NOT NULL default ''");
+  $ret[] = update_sql("ALTER TABLE {hosting_web_server} ADD COLUMN server_certificate_key longtext NOT NULL default ''");
+  return $ret;
+}
\ No newline at end of file
diff --git a/modules/hosting/web_server/hosting_web_server.service.inc b/modules/hosting/web_server/hosting_web_server.service.inc
index 71a0079..881ec84 100644
--- a/modules/hosting/web_server/hosting_web_server.service.inc
+++ b/modules/hosting/web_server/hosting_web_server.service.inc
@@ -6,14 +6,14 @@ class hostingService_HTTP extends hostingService {
 
   public function load() {
     parent::load();
-    $this->mergeData('SELECT web_group, restart_cmd, ports FROM {hosting_web_server} WHERE vid = %d', $this->server->vid);
+    $this->mergeData('SELECT web_group, restart_cmd, ports, server_certificate_file, server_certificate_key FROM {hosting_web_server} WHERE vid = %d', $this->server->vid);
   }
 
   function insert() {
     parent::insert();
-    db_query("INSERT INTO {hosting_web_server} (vid, nid, web_group, restart_cmd, ports) 
-        VALUES (%d, %d, '%s', '%s', '%s')", 
-          $this->server->vid, $this->server->nid, $this->web_group, $this->restart_cmd, $this->ports);
+    db_query("INSERT INTO {hosting_web_server} (vid, nid, web_group, restart_cmd, ports, server_certificate_file, server_certificate_key)
+        VALUES (%d, %d, '%s', '%s', '%s', '%s', '%s')",
+          $this->server->vid, $this->server->nid, $this->web_group, $this->restart_cmd, $this->ports, $this->server_certificate_file, $this->server_certificate_key);
   }
 
 
@@ -77,6 +77,27 @@ class hostingService_HTTP extends hostingService {
       '#weight' => -5,
     );
 
+    if (hosting_feature('ssl') == HOSTING_FEATURE_ENABLED) {
+      $form['server_certificate_file'] = array(
+        '#type' => 'textfield',
+        '#title' => t('Server-wide certificate file'),
+        '#description' => t('The absolute path to the server-wide certificate file'),
+        '#default_value' => ($this->server_certificate_file) ? $this->server_certificate_file : '',
+        '#size' => 40,
+        '#maxlength' => 255,
+        '#weight' => -4,
+      );
+      $form['server_certificate_key'] = array(
+        '#type' => 'textfield',
+        '#title' => t('Server-wide certificate key file'),
+        '#description' => t('The absolute path to the server-wide certificate key file'),
+        '#default_value' => ($this->server_certificate_key) ? $this->server_certificate_key : '',
+        '#size' => 40,
+        '#maxlength' => 255,
+        '#weight' => -3,
+      );
+    }
+
   }
 
   function view(&$render) {
@@ -98,6 +119,24 @@ class hostingService_HTTP extends hostingService {
       '#title' => t('Restart command'),
       '#value' => filter_xss($this->restart_cmd),
     );
+
+    if (hosting_feature('ssl') == HOSTING_FEATURE_ENABLED) {
+      if ($this->server_certificate_file) {
+        $render['server_certificate_file'] = array(
+          '#type' => 'item',
+          '#title' => t('SSL certificate file'),
+          '#value' => filter_xss($this->server_certificate_file),
+        );
+      }
+
+      if ($this->server_certificate_key) {
+        $render['server_certificate_key'] = array(
+          '#type' => 'item',
+          '#title' => t('SSL certificate key file'),
+          '#value' => filter_xss($this->server_certificate_key),
+        );
+      }
+    }
   }
 
   function delete() {
@@ -132,10 +171,13 @@ class hostingService_HTTP extends hostingService {
       }
     }
 
-   if ($task_type == 'verify' && $ref_type == 'platform') {
+    if ($task_type == 'verify' && $ref_type == 'platform') {
       $task->options['web_group'] = $this->web_group;
       $task->options['restart_cmd'] = $this->restart_cmd;
     }
+
+    $task->options['server_certificate_file'] = $this->server_certificate_file;
+    $task->options['server_certificate_key'] = $this->server_certificate_key;
   }
 }
 
