From ba68bd99418aa44d125b154bdb6aa88d895c848d Mon Sep 17 00:00:00 2001 From: David Duque Date: Mon, 1 Feb 2021 02:20:38 +0000 Subject: [PATCH] Automatically import existing local CA cerificates --- .gitignore | 3 ++- setup/management.sh | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 14e6c4a7..104111b7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ tools/__pycache__/ externals/ .env .vagrant -api/docs/api-docs.html \ No newline at end of file +api/docs/api-docs.html +mailinabox-ca.crt diff --git a/setup/management.sh b/setup/management.sh index 7ec69ee0..352bac84 100755 --- a/setup/management.sh +++ b/setup/management.sh @@ -126,3 +126,14 @@ EOF # Start the management server. restart_service mailinabox + +# FOR DEVELOPMENT PURPOSES ONLY: +# If there is a CA certificate in the folder, install it. +# MIAB will only accept a manual certificate installation +# if it is signed by a CA trusted by it. +if [[ -f mailinabox-ca.crt ]]; then + echo "Custom CA certificate detected. Installing..." + rm -f /usr/local/share/ca-certificates/mailinabox-ca.crt + cp mailinabox-ca.crt /usr/local/share/ca-certificates/ + update-ca-certificates --fresh +fi