-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_certs.sh
executable file
·47 lines (34 loc) · 947 Bytes
/
install_certs.sh
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
#!/bin/bash
### Script installs root.cert.pem to certificate trust store of applications using NSS
### (e.g. Firefox, Thunderbird, Chromium)
### Mozilla uses cert8, Chromium and Chrome use cert9
###
### Requirement: apt install libnss3-tools
###
# Install libnss3
apt -y --no-install-recommends install libnss3-tools
###
### CA file to install (CUSTOMIZE!)
###
###
### For cert8 (legacy - DBM)
###
for certDB in $(find /home/${COOP_USER}/ -name "cert8.db")
do
certdir=$(dirname ${certDB});
certutil -A -n "${CERT_NAME}" -t "TCu,Cu,Tu" -i ${CERT_NAME}.pem -d dbm:${certdir}
done
###
### For cert9 (SQL)
###
for certDB in $(find /home/${COOP_USER}/ -name "cert9.db")
do
certdir=$(dirname ${certDB});
certutil -A -n "${CERT_NAME}" -t "TCu,Cu,Tu" -i ${CERT_NAME}.pem -d sql:${certdir}
done
###
### NGINX
###
mkdir -p /etc/nginx/ssl
cp localhost.key.pem /etc/nginx/ssl/posbox.key
cp localhost.crt /etc/nginx/ssl/posbox.crt