From: Joshua T Corbin Date: Thu, 8 Jan 2009 23:52:57 +0000 (-0500) Subject: Catch and describe IO errors in SslServer::setCertificate. X-Git-Tag: 0.4.0~204 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=fe1d4d5399d9dc215c6c0cb5527c9b24b367158f Catch and describe IO errors in SslServer::setCertificate. --- diff --git a/src/core/sslserver.cpp b/src/core/sslserver.cpp index 7fee3ca5..8006ebdb 100644 --- a/src/core/sslserver.cpp +++ b/src/core/sslserver.cpp @@ -72,10 +72,19 @@ bool SslServer::setCertificate(const QString &path) { return false; } - certFile.open(QIODevice::ReadOnly); + if (! certFile.open(QIODevice::ReadOnly)) { + qWarning() + << "SslServer: Failed to open certificate file" << qPrintable(path) + << "error:" << certFile.error(); + return false; + } _cert = QSslCertificate(&certFile); - certFile.reset(); + if (! certFile.reset()) { + qWarning() << "SslServer: IO error reading certificate file"; + return false; + } + _key = QSslKey(&certFile, QSsl::Rsa); certFile.close();