Changeset 9726 in ntrip
- Timestamp:
- May 19, 2022, 10:38:53 PM (3 years ago)
- Location:
- trunk/BNC/src/upload
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/upload/bncuploadcaster.cpp
r9725 r9726 119 119 emit newMessage("slotProxyAuthenticationRequired", true); 120 120 } 121 122 // TSL/SSL 123 //////////////////////////////////////////////////////////////////////////// 124 void 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 121 157 122 158 // Endless Loop … … 194 230 195 231 _outSocket = new QSslSocket(); 232 _outSocket->setSslConfiguration(sslConfig); 196 233 _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>))); 202 235 203 236 if (_proxy) { -
trunk/BNC/src/upload/bncuploadcaster.h
r9725 r9726 36 36 private slots: 37 37 void slotProxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*); 38 void slotSslErrors(QList<QSslError>); 38 39 39 40 private:
Note:
See TracChangeset
for help on using the changeset viewer.