Ignore:
Timestamp:
May 19, 2022, 1:13:04 PM (2 years ago)
Author:
stuerze
Message:

minor changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/upload/bncuploadcaster.cpp

    r9720 r9724  
    123123 ////////////////////////////////////////////////////////////////////////////
    124124 void bncUploadCaster::slotSslErrors(QList<QSslError> errors) {
    125 
    126  QString msg = "SSL Error\n";
    127  QSslCertificate cert = _outSocket->sslConfiguration().peerCertificate();
    128  if (!cert.isNull() &&
    129      cert.issuerInfo(QSslCertificate::OrganizationalUnitName).count() &&
    130      cert.issuerInfo(QSslCertificate::Organization).count()) {
    131 
    132    msg += QString("Server Certificate Issued by:\n"
    133                   "%1\n%2\nCannot be verified\n")
    134 #if QT_VERSION >= 0x050000
    135           .arg(cert.issuerInfo(QSslCertificate::OrganizationalUnitName).at(0))
    136           .arg(cert.issuerInfo(QSslCertificate::Organization).at(0));
    137 #else
    138           .arg(cert.issuerInfo(QSslCertificate::OrganizationalUnitName))
    139           .arg(cert.issuerInfo(QSslCertificate::Organization));
    140 #endif
    141   }
    142 
    143   QListIterator<QSslError> it(errors);
    144   while (it.hasNext()) {
    145     const QSslError& err = it.next();
    146     msg += "\n" + err.errorString();
    147   }
    148   emit(newMessage(msg.toLatin1(), true));
    149 
    150   if (_sslIgnoreErrors) { cout << "_sslIgnoreErrors" << endl;
    151     if (_outSocket) {cout << "no Socket" << endl;
    152       _outSocket->ignoreSslErrors();
    153     } else {
    154       cout << "no Socket" << endl;
    155     }
    156   } else {
    157     delete _outSocket;
    158     _outSocket = 0;
    159   }
     125   QString msg = "SSL Error: ";
     126   QSslCertificate cert = _outSocket->sslConfiguration().peerCertificate();
     127   if (!cert.isNull() &&
     128       cert.issuerInfo(QSslCertificate::OrganizationalUnitName).count() &&
     129       cert.issuerInfo(QSslCertificate::Organization).count()) {
     130
     131     msg += QString("Server Certificate Issued by:\n"
     132                    "%1\n%2\nCannot be verified\n")
     133 #if QT_VERSION >= 0x050000
     134            .arg(cert.issuerInfo(QSslCertificate::OrganizationalUnitName).at(0))
     135            .arg(cert.issuerInfo(QSslCertificate::Organization).at(0));
     136 #else
     137            .arg(cert.issuerInfo(QSslCertificate::OrganizationalUnitName))
     138            .arg(cert.issuerInfo(QSslCertificate::Organization));
     139 #endif
     140   }
     141
     142   QListIterator<QSslError> it(errors);
     143   while (it.hasNext()) {
     144     const QSslError& err = it.next();
     145     msg += err.errorString();
     146   }
     147   emit(newMessage(msg.toLatin1(), true));
     148
     149   if (_sslIgnoreErrors) {cout << "_sslIgnoreErrors" << endl;
     150     if (_outSocket) {
     151       _outSocket->ignoreSslErrors();
     152       emit(newMessage("BNC ignores SSL errors as configured", true));
     153     } else {
     154       cout << "no Socket" << endl;
     155     }
     156   }
     157   else {
     158     delete _outSocket;
     159     _outSocket = 0;
     160   }
     161   return;
    160162}
    161163
Note: See TracChangeset for help on using the changeset viewer.