Changeset 9726 in ntrip


Ignore:
Timestamp:
May 19, 2022, 10:38:53 PM (6 weeks ago)
Author:
stuerze
Message:

minor changes

Location:
trunk/BNC/src/upload
Files:
2 edited

Legend:

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

    r9725 r9726  
    119119  emit newMessage("slotProxyAuthenticationRequired", true);
    120120}
     121
     122// TSL/SSL
     123 ////////////////////////////////////////////////////////////////////////////
     124void bncUploadCaster::slotSslErrors(QList<QSslError> errors) {
     125  QString msg = "SSL Error: ";
     126  if (_outSocket) {
     127    QSslCertificate cert = _outSocket->sslConfiguration().peerCertificate();
     128    if (!cert.isNull() &&
     129         cert.issuerInfo(QSslCertificate::OrganizationalUnitName).count() &&
     130         cert.issuerInfo(QSslCertificate::Organization).count()) {
     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    cout << "msg.toStdString(): " << msg.toStdString().c_str() << endl;
     148    emit(newMessage(msg.toLatin1(), true));
     149
     150    if (_sslIgnoreErrors) {
     151      _outSocket->ignoreSslErrors();
     152      emit(newMessage("BNC ignores SSL errors as configured", true));
     153    }
     154  }
     155}
     156
    121157
    122158// Endless Loop
     
    194230
    195231  _outSocket = new QSslSocket();
     232  _outSocket->setSslConfiguration(sslConfig);
    196233  _outSocket->setProxy(QNetworkProxy::NoProxy);
    197   _outSocket->setSslConfiguration(sslConfig);
    198   if (_sslIgnoreErrors) {
    199     _outSocket->ignoreSslErrors();
    200     emit(newMessage("BNC ignores SSL errors as configured", true));
    201   }
     234  connect(_outSocket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(slotSslErrors(QList<QSslError>)));
    202235
    203236  if (_proxy) {
  • trunk/BNC/src/upload/bncuploadcaster.h

    r9725 r9726  
    3636 private slots:
    3737  void slotProxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*);
     38  void slotSslErrors(QList<QSslError>);
    3839
    3940 private:
Note: See TracChangeset for help on using the changeset viewer.