Skip to content

Commit 8a52144

Browse files
author
Long Nguyen
authored
Merge pull request #62 from cloudfoundry/clear-trusted-certs
Adding the option to delete system certificates to the job ca_certs
2 parents 875d1b0 + 7cb97a8 commit 8a52144

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

jobs/ca_certs/spec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ templates:
66
pre-start.sh.erb: bin/pre-start
77

88
properties:
9+
delete_system_certs:
10+
description: "Flag to delete the default trusted certificate store"
11+
default: false
912
certs:
1013
description: "Concatenated set of certificates in PEM format"
1114
default: ""

jobs/ca_certs/templates/pre-start.sh.erb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44

55
CONF_DIR=/var/vcap/jobs/ca_certs/config
66

7+
<% if p("delete_system_certs") %>
8+
# deleting the certificates on ca-certificates.conf
9+
echo '' > /etc/ca-certificates.conf
10+
rm -rf /usr/share/ca-certificates/*
11+
# choose to *not* trust new certs
12+
echo 'ca-certificates ca-certificates/trust_new_crts select no' | debconf-set-selections -
13+
<% end %>
14+
715
echo "deleting old certificates"
816
rm -f /usr/local/share/ca-certificates/bosh_os_conf_ca_cert_*
917

0 commit comments

Comments
 (0)