Skip to content

Commit

Permalink
Backup SSL cert when using Nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Dec 2, 2022
1 parent 66d0cbc commit f99e871
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions virtual_feature.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2451,6 +2451,20 @@ sub feature_backup
&$virtual_server::second_print($virtual_server::text{'setup_done'});
}

# Save SSL cert and key
my $cert = &feature_get_web_ssl_file($d, 'cert');
my $key = &feature_get_web_ssl_file($d, 'key');
my $ca = &feature_get_web_ssl_file($d, 'ca');
if ($cert) {
&virtual_server::copy_write_as_domain_user($d, $cert, $file."_cert");
}
if ($key) {
&virtual_server::copy_write_as_domain_user($d, $key, $file."_key");
}
if ($ca) {
&virtual_server::copy_write_as_domain_user($d, $ca, $file."_ca");
}

return 1;
}

Expand Down

0 comments on commit f99e871

Please sign in to comment.