#!/bin/bash
|
|
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
|
|
INSTALLDIR="/usr/local/ComarchCryptoProvider"
|
|
echo "Generating self-signed certificate for localhost..."
|
openssl genrsa -out ${INSTALLDIR}/certs/CCP-key-server.pem
|
openssl req -x509 -sha256 -days 1000 \
|
-config "${INSTALLDIR}/openssl.cnf" \
|
-subj "/CN=localhost/O=ComarchCryptoProvider" \
|
-key "${INSTALLDIR}/certs/CCP-key-server.pem" \
|
-out "${INSTALLDIR}/certs/CCP-cert-server.pem"
|
|
echo "Trust this self-signed certificate..."
|
cp "${INSTALLDIR}/certs/CCP-cert-server.pem" "/usr/local/share/ca-certificates/CCP-cert-server.crt"
|
|
dpkg-trigger update-ca-certificates-fresh
|
|
fi
|
|
#DEBHELPER#
|