Skip to content

Commit 3938388

Browse files
committed
systemvmtemplate: add Letsencrypt CA cert
Fixes #2541 On patching, the global cacerts keystore is imported in 'cloud' service specific local keystore. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent 684d2de commit 3938388

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

systemvm/debian/opt/cloud/bin/setup/patchsystemvm.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ patch_systemvm() {
3737
echo "Restored keystore file and certs using backup" >> $logfile
3838
fi
3939
rm -fr $backupfolder
40+
# Import global cacerts into 'cloud' service's keystore
41+
keytool -importkeystore -srckeystore /etc/ssl/certs/java/cacerts -destkeystore /usr/local/cloud/systemvm/certs/realhostip.keystore -srcstorepass changeit -deststorepass vmops.com -noprompt || true
4042
return 0
4143
}
4244

tools/appliance/systemvmtemplate/scripts/configure_systemvm_services.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
set -e
2020
set -x
2121

22-
CLOUDSTACK_RELEASE=4.11.0
22+
CLOUDSTACK_RELEASE=4.11.1
2323

2424
function configure_apache2() {
2525
# Enable ssl, rewrite and auth
@@ -31,6 +31,16 @@ function configure_apache2() {
3131
sed -i 's/SSLProtocol .*$/SSLProtocol TLSv1.2/g' /etc/apache2/mods-available/ssl.conf
3232
}
3333

34+
function configure_cacerts() {
35+
CDIR=$(pwd)
36+
cd /tmp
37+
# Add LetsEncrypt ca-cert
38+
wget https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.der
39+
keytool -trustcacerts -keystore /etc/ssl/certs/java/cacerts -storepass changeit -noprompt -importcert -alias letsencryptauthorityx3cross -file lets-encrypt-x3-cross-signed.der || true
40+
rm -f lets-encrypt-x3-cross-signed.der
41+
cd $CDIR
42+
}
43+
3444
function install_cloud_scripts() {
3545
# ./cloud_scripts/ has been put there by ../../cloud_scripts_shar_archive.sh
3646
rsync -av ./cloud_scripts/ /
@@ -102,6 +112,7 @@ function configure_services() {
102112
configure_apache2
103113
configure_strongswan
104114
configure_issue
115+
configure_cacerts
105116
}
106117

107118
return 2>/dev/null || configure_services

0 commit comments

Comments
 (0)