-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathautocert.sh
More file actions
executable file
·62 lines (57 loc) · 2.29 KB
/
autocert.sh
File metadata and controls
executable file
·62 lines (57 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
#
# Copyright © 2024 Quintor B.V.
#
# BCLD is gelicentieerd onder de EUPL, versie 1.2 of
# – zodra ze zullen worden goedgekeurd door de Europese Commissie -
# latere versies van de EUPL (de "Licentie");
# U mag BCLD alleen gebruiken in overeenstemming met de licentie.
# U kunt een kopie van de licentie verkrijgen op:
#
# https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
#
# Tenzij vereist door de toepasselijke wetgeving of overeengekomen in
# schrijven, wordt software onder deze licentie gedistribueerd
# gedistribueerd op een "AS IS"-basis,
# ZONDER ENIGE GARANTIES OF VOORWAARDEN, zowel
# expliciet als impliciet.
# Zie de licentie voor de specifieke taal die van toepassing is
# en de beperkingen van de licentie.
#
#
# Copyright © 2024 Quintor B.V.
#
# BCLD is licensed under the EUPL, Version 1.2 or
# – as soon they will be approved by the European Commission -
# subsequent versions of the EUPL (the "Licence");
# You may not use BCLD except in compliance with the Licence.
# You may obtain a copy of the License at:
#
# https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
#
# Unless required by applicable law or agreed to in
# writing, software distributed under the License is
# distributed on an "AS IS" basis,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied.
# See the License for the specific language governing
# permissions and limitations under the License.
#
#
# BCLD AutoCert
# Script for automatically selecting the right certificate (WFT instead of Facet).
#
# Skip entire execution unless WFT
if [[ "${BCLD_VENDOR}" == 'wft' ]]; then
source '/bin/log_tools.sh'
CHROME_CERT='/etc/chromium/policies/managed/auto_select_certificate.json'
# When RELEASE, use different INPUT_STRING
if [[ "${BCLD_MODEL}" == 'release' ]]; then
INPUT_STRING='{ "AutoSelectCertificateForUrls": ["{\"pattern\":\"juno.optimumassessment.com/:443\",\"filter\":{\"CN\":\"KPN PKIoverheid Private Services CA - G1\"}}"] }'
else
INPUT_STRING='{ "AutoSelectCertificateForUrls": ["{\"pattern\":\"juno-acc.optimumassessment.com/:443\",\"filter\":{\"CN\":\"KPN PKIoverheid Private Services CA - G1\"}}"] }'
fi
# Update autocerts if wft
log_line 'Updating autocert for WFT...'
/usr/bin/echo "${INPUT_STRING}" | /usr/bin/sudo /usr/bin/tee "${CHROME_CERT}" &> /dev/null
fi