Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problem with Ssl
Forum Updated to NodeBB v4.3 + New Features

Problem with Ssl

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 785 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Romaniy
    wrote on last edited by
    #1

    Hello everyone.

    I have problem with ssl.
    My code Next:

    @void LogIn::checkResponce() {
    QNetworkReply reply = qobject_cast<QNetworkReply>(sender());
    qDebug() << "1";
    if (reply) {
    qDebug() << "2";
    qDebug() << reply->errorString();
    qDebug() << reply->error();
    if (reply->error() == QNetworkReply::NoError) {
    qDebug() << "3";
    qDebug() << reply->readAll();
    }
    reply->deleteLater();
    }
    }

    void LogIn::checkSslError(QList<QSslError> am) {
    while(!am.isEmpty()) {
    qDebug() << am.at(0).error();
    qDebug() << am.at(0).errorString();
    am.takeFirst();
    }
    }

    void LogIn::loginCheck()
    {
    emit disable(true);
    QNetworkAccessManager netManager;
    QUrl url("https://localhost/test.cgi");
    QNetworkRequest req(url);
    QNetworkReply* repl;
    QList<QSslCertificate> cert = QSslCertificate::fromPath(QLatin1String("cert.pem"));
    qDebug() << cert.at(0).isNull();
    QSslError error(QSslError::SelfSignedCertificate , cert.at(0));
    QSslError error1(QSslError::CertificateUntrusted , cert.at(0));
    QList<QSslError> expectedSslErrors;
    expectedSslErrors.append(error);
    expectedSslErrors.append(error1);

    repl = netManager.get(req);
    repl->ignoreSslErrors(expectedSslErrors);
    
    connect(repl, SIGNAL(finished()), this, SLOT(checkResponce()));
    connect(repl , SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(checkSslError(QList<QSslError>)));
    

    }@

    But in console i have next text:
    "The certificate is self-signed, and untrusted"
    "The certificate is self-signed, and untrusted"
    1
    2
    "SSL handshake failed"
    6

    But I have already added this error before as you can see.
    Please help me.

    Thank

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Stoff81
      wrote on last edited by
      #2

      Hi there,

      I am having a similar error on Mavericks. Did you ever manage to resolve the issue?

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved