Changeset 3350 in ntrip


Ignore:
Timestamp:
Aug 22, 2011, 1:34:04 PM (13 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncsslconfig.cpp

    r3349 r3350  
    2121// Constructor
    2222////////////////////////////////////////////////////////////////////////////
    23 bncSslConfig::bncSslConfig() {
    24   QList<QSslCertificate> caCerts =
    25     QSslCertificate::fromPath("/home/mervart/certs/bkg.crt");
     23bncSslConfig::bncSslConfig() :
     24  QSslConfiguration(QSslConfiguration::defaultConfiguration())
     25{
     26
     27  QString dirName =  QDir::homePath() + QDir::separator()
     28                  + ".config" + QDir::separator() + qApp->organizationName();
     29
     30  QList<QSslCertificate> caCerts = this->caCertificates();
     31
     32  // Bug in Qt: the wildcard does not work here:
     33  // -------------------------------------------
     34  // caCerts += QSslCertificate::fromPath(dirName + QDir::separator() + "*crt",
     35  //                                      QSsl::Pem, QRegExp::Wildcard);
     36  QDir dir(dirName);
     37  QStringList nameFilters; nameFilters << "*.crt";
     38  QStringList fileNames = dir.entryList(nameFilters, QDir::Files);
     39  QStringListIterator it(fileNames);
     40  while (it.hasNext()) {
     41    QString fileName = it.next();
     42    caCerts += QSslCertificate::fromPath(dirName+QDir::separator()+fileName);
     43  }
     44 
    2645  this->setCaCertificates(caCerts);
    2746}
Note: See TracChangeset for help on using the changeset viewer.