1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2026-01-05 17:37:03 +00:00

smtpsrv: Fail to listen if there are no certificates configured

The server is written assuming there's at least one valid SSL/TLS
certificate. For example, it unconditionally advertises STARTTLS, and
only supports AUTH over TLS.

This patch makes the server fail to listen if there are no certificates
configured, so the users don't accidentally run an unsupported
configuration.
This commit is contained in:
Alberto Bertogli
2016-11-24 10:09:11 +00:00
parent de09923933
commit 75cc038e68
2 changed files with 15 additions and 0 deletions

View File

@@ -5,6 +5,12 @@ set -e
init
# This should fail, as it has no certificates.
rm config/certs/testserver/*.pem
if chasquid -v=2 --logfile=.logs/chasquid.log --config_dir=config; then
fail "chasquid should not start without certificates"
fi
generate_certs_for testserver
add_user user@testserver secretpassword
add_user someone@testserver secretpassword