X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fsslserver.cpp;fp=src%2Fcore%2Fsslserver.cpp;h=c93f4861bae3064799bd7c3e23e43568ab6e9665;hp=9c3c7edc15fde749230164c77249990a1dc87e6b;hb=f20d380a36e11a7591dacbf0a62d7c11d997f9db;hpb=322bec12418ab267d7b770ec90465a1a1034b17d diff --git a/src/core/sslserver.cpp b/src/core/sslserver.cpp index 9c3c7edc..c93f4861 100644 --- a/src/core/sslserver.cpp +++ b/src/core/sslserver.cpp @@ -49,6 +49,12 @@ SslServer::SslServer(QObject* parent) // Initialize the certificates for first-time usage if (!loadCerts()) { + // If the core is unable to load a certificate, and "--require-ssl" is specified, + // do not proceed, throw an exception and quit. This prevents the core from falling + // back to a plaintext-only core when they should be expecting SSL/TLS only. + if (Quassel::isOptionSet("require-ssl")) { + throw ExitException{EXIT_FAILURE, tr("--require-ssl is set, but no SSL certificate is available. Exiting.")}; + } if (!sslWarningShown) { qWarning() << "SslServer: Unable to set certificate file\n" << " Quassel Core will still work, but cannot provide SSL for client connections.\n"