Add a flag to enable Qt deprecation warnings on Qt < 5.13
[quassel.git] / src / core / sslserver.cpp
index d3b6070..16e3f3e 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2018 by the Quassel Project                        *
+ *   Copyright (C) 2005-2019 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -26,6 +26,7 @@
 
 #include <QDateTime>
 
+#include "core.h"
 #include "quassel.h"
 
 #ifdef HAVE_SSL
@@ -199,6 +200,11 @@ bool SslServer::setCertificate(const QString& path, const QString& keyPath)
         return false;
     }
 
+    _certificateExpires = untestedCert.expiryDate();
+    if (_metricsServer) {
+        _metricsServer->setCertificateExpires(_certificateExpires);
+    }
+
     _isCertValid = true;
 
     // All keys are valid, update the externally visible copy used for new connections.
@@ -223,4 +229,11 @@ QSslKey SslServer::loadKey(QFile* keyFile)
     return key;
 }
 
+void SslServer::setMetricsServer(MetricsServer* metricsServer) {
+    _metricsServer = metricsServer;
+    if (_metricsServer) {
+        _metricsServer->setCertificateExpires(_certificateExpires);
+    }
+}
+
 #endif  // HAVE_SSL