Commit 93e07015 authored by Steven Jones's avatar Steven Jones

Add patch from #1062168 comment 6.

By EugenMayer: Added chained certificates support.
parent 7a8b9b97
......@@ -30,6 +30,11 @@
SSLCertificateKeyFile <?php print $ssl_cert_key; ?>
<?php
if(!empty($ssl_chain_cert)) {
print "SSLCertificateChainFile $ssl_chain_cert";
}
?>
<?php
if (sizeof($this->aliases)) {
print "\n ServerAlias " . implode("\n ServerAlias ", $this->aliases) . "\n";
......
......@@ -105,7 +105,13 @@ class provisionService_http_ssl extends provisionService_http_public {
$path = "{$this->server->http_ssld_path}/{$ssl_key}";
$certs['ssl_cert_key'] = "{$path}/openssl.key";
$certs['ssl_cert'] = "{$path}/openssl.crt";
// If the chain file exists, add it
$chain_cert_source = "{$source_path}/openssl_chain.crt";
if( provision_file()->exists($chain_cert_source)->status() ) {
$certs['ssl_chain_cert'] = "{$path}/openssl_chain.crt";
$certs['ssl_chain_cert_source'] = $chain_cert_source;
}
return $certs;
}
......@@ -296,7 +302,12 @@ class provisionConfig_http_ssl_site extends provisionConfig_http_site {
provision_file()->copy(
$this->data['ssl_cert_key_source'],
$this->data['ssl_cert_key']);
// Copy the chain certificate, if it is set
if(!empty($this->data['ssl_chain_cert_source'])) {
provision_file()->copy(
$this->data['ssl_chain_cert_source'],
$this->data['ssl_chain_cert']);
}
// Sync the key directory to the remote server.
$this->data['server']->sync($path, array(
'exclude' => "{$path}/*.receipt", // Don't need to synch the receipts
......
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