-#ifndef QT_NO_OPENSSL
-void ClientSyncer::sslErrors(const QList<QSslError> &errors) {
- qDebug() << "SSL Errors:";
- foreach(QSslError err, errors)
- qDebug() << " " << err;
+void ClientSyncer::setWarningsHandler(const char *slot) {
+ resetWarningsHandler();
+ connect(this, SIGNAL(handleIgnoreWarnings(bool)), this, slot);
+}
+
+void ClientSyncer::resetWarningsHandler() {
+ disconnect(this, SIGNAL(handleIgnoreWarnings(bool)), this, 0);
+}
+
+void ClientSyncer::resetConnection() {
+}
+
+#ifdef HAVE_SSL
+void ClientSyncer::ignoreSslWarnings(bool permanently) {
+ QSslSocket *sock = qobject_cast<QSslSocket *>(_socket);
+ if(sock) {
+ // ensure that a proper state is displayed and no longer a warning
+ emit socketStateChanged(sock->state());
+ }
+ if(permanently) {
+ if(!sock)
+ qWarning() << Q_FUNC_INFO << "unable to save cert digest! Socket is either a nullptr or not a QSslSocket";
+ else
+ KnownHostsSettings().saveKnownHost(sock);
+ }
+ emit connectionMsg(_coreMsgBuffer["CoreInfo"].toString());
+ connectionReady();
+}
+
+void ClientSyncer::sslSocketEncrypted() {
+ QSslSocket *socket = qobject_cast<QSslSocket *>(sender());
+ if(socket) {
+ QByteArray digest = socket->peerCertificate().digest();
+ }
+}