Changeset 9795 in ntrip for trunk/BNC/src/upload
- Timestamp:
- Jul 22, 2022, 1:34:16 PM (3 years ago)
- Location:
- trunk/BNC/src/upload
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/upload/bncuploadcaster.cpp
r9757 r9795 79 79 _secure = true; 80 80 _casterOutPort = 443; 81 // Generate filenames to consider a potential client certificate and private key 82 _crtFileName = settings.value("sslClientCertPath").toString() + _casterOutHost + QString(".%1.crt").arg(_casterOutPort); 83 _keyFileName = settings.value("sslClientCertPath").toString() + _casterOutHost + QString(".%1.key").arg(_casterOutPort); 81 84 } 82 85 } … … 215 218 _outSocket->ignoreSslErrors(); 216 219 } else { 217 _outSocket->setSslConfiguration(BNC_SSL_CONFIG); 220 bncSslConfig sslConfig = BNC_SSL_CONFIG; 221 QFile clientCrtFile(_crtFileName); 222 QFile privateKeyFile(_keyFileName); 223 if ( clientCrtFile.exists() && privateKeyFile.exists()) { 224 // set local certificate 225 clientCrtFile.open(QIODevice::ReadOnly); 226 QSslCertificate clientCrt(&clientCrtFile); 227 sslConfig.setLocalCertificate(clientCrt); 228 // set private key if available 229 privateKeyFile.open(QIODevice::ReadOnly); 230 QSslKey privateKey(&privateKeyFile, QSsl::Rsa); 231 sslConfig.setPrivateKey(privateKey); 232 } 233 _outSocket->setSslConfiguration(sslConfig); 218 234 connect(_outSocket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(slotSslErrors(QList<QSslError>))); 219 235 } -
trunk/BNC/src/upload/bncuploadcaster.h
r9748 r9795 8 8 #include <QThread> 9 9 #include <QSslError> 10 #include <QSslKey> 10 11 #include <iostream> 11 12 … … 50 51 QString _proxyOutHost; 51 52 int _proxyOutPort; 53 QString _crtFileName; 54 QString _keyFileName; 52 55 QString _userName; 53 56 QString _password;
Note:
See TracChangeset
for help on using the changeset viewer.