+
+ if (Quassel::isOptionSet("ssl-cert")) {
+ _sslCertPath = Quassel::optionValue("ssl-cert");
+ }
+ else {
+ _sslCertPath = Quassel::configDirPath() + "quasselCert.pem";
+ }
+
+ if (Quassel::isOptionSet("ssl-key")) {
+ _sslKeyPath = Quassel::optionValue("ssl-key");
+ }
+ else {
+ _sslKeyPath = _sslCertPath;
+ }
+
+ // 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.\n"
+ "Please see https://quassel-irc.org/faq/cert to learn how to enable SSL support.")};
+ }