8
0
mirror of https://github.com/key-networks/ztncui.git synced 2024-08-31 04:28:00 +00:00

Issue#36: .deb deploys default TLS certificate and private key (#39)

* issue#36: Generating TLS key and self-signed cert after installing/upgrading the package

* issue#36: Updated libstdc++.a dependency to v10

* issue#36: Generate self-signed certs after install/upgrade

* issue#36: Updated dependencies

* issue#36: Check for pre-existence of key/cert
This commit is contained in:
key-networks
2021-01-14 19:41:49 +08:00
committed by GitHub
parent 537a567e29
commit ab057c854c
5 changed files with 52 additions and 19 deletions

View File

@@ -1,2 +1,11 @@
#!/bin/bash
if [ -f /opt/key-networks/ztncui/etc/tls/privkey.pem ] && [ -f /opt/key-networks/ztncui/etc/tls/fullchain.pem ]; then
echo "TLS key and certificate already exist"
else
echo "Generating new TLS key and self-signed certificate..."
openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout /opt/key-networks/ztncui/etc/tls/privkey.pem -out /opt/key-networks/ztncui/etc/tls/fullchain.pem -subj "/C=XX/ST=YY/L=ZZ/O=Security/OU=SelfSigned/CN=example.com"
fi
chown ztncui.ztncui /opt/key-networks/ztncui/etc/tls/*
systemctl daemon-reload
systemctl try-restart ztncui