Results 1 to 6 of 6

Thread: QNetworkAccessManager get request causing QSslSocket errors

  1. #1
    Join Date
    Jul 2009
    Posts
    7
    Thanks
    1
    Thanked 2 Times in 1 Post

    Default QNetworkAccessManager get request causing QSslSocket errors

    Hey everybody, thanks for your help. I've been struggling for days with this and I'm losing my patience. I have written a program in Linux (Ubuntu 8.1), WOOHOO, and now trying to deploy it in Windows (BOOOOOOO) is giving me an error with my QNetworkRequest.

    Qt Code:
    1. #include <QNetworkRequest>
    2. #include <QNetworkReply>
    3. #include <QSslSocket>
    4.  
    5. void MainWindow::downloadLatestMaster(QString process)
    6. {
    7. myrUrl="http://my.hosted.server/pagetoload.php";
    8.  
    9. // file init
    10. if(!file.open(QIODevice::ReadWrite|QIODevice::Text)) {
    11. ui->textEdit->append(QString("!! - Failed to open "+file.fileName()));
    12. // further error handling
    13. } else {
    14. // request init
    15. QNetworkRequest request(myUrl);
    16. reply=manager.get(request); // perform get request
    17.  
    18. // connections connect(reply,SIGNAL(downloadProgress(qint64,qint64)),SLOT(mySetValue(qint64,qint64)));
    19. connect(reply,SIGNAL(readyRead()),SLOT(downloadReadyRead())); // reply ready - output file
    20. connect(reply,SIGNAL(finished()),SLOT(replyFinished())); // reply finished - close file
    21. }
    22. }
    23.  
    24. // output file contents
    25. void MainWindow::downloadReadyRead()
    26. {
    27. file.write(reply->readAll());
    28. }
    29.  
    30. // close file and update ui
    31. void MainWindow::replyFinished()
    32. {
    33. file.close();
    34. }
    To copy to clipboard, switch view to plain text mode 


    Instead of the normal operation I experience in Linux (WOOHOO) I see the fillowing in my output window:

    QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf
    QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf
    QSslSocket: cannot call unresolved function OPENSSL_add_all_algorithms_noconf

    Before I added the #include <QSslSocket> my proress bar didn't work and the request seemed to just be skipped over. Now that I added the include my progress bar updates, but no file is written and the data in my reply is just empty.

    I am confused because I never access an SSL socket, though I can conceive that perhaps the QNetworkAccessManager does. Is this because of some shared vs. linked building problem? Am I just crazy? If anyone has come across this issue before and could possibly shed some light on my error I would so greatly appreciate it. Thank you.

    Oh, by the way, I did try substituting the QNetwrokReply for an QHttp request and same error. Please help!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QNetworkAccessManager get request causing QSslSocket errors

    Do you have OpenSSL libraries installed and OpenSSL support compiled into Qt?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jul 2009
    Posts
    7
    Thanks
    1
    Thanked 2 Times in 1 Post

    Default Re: QNetworkAccessManager get request causing QSslSocket errors

    I just installed OpenSsl and I no longer receive the error messages, though I am still receiving no bytes of data. All I did was install OpenSsl, I have not compiled support for it into Qt and I am at a loss as to how to go about doing that or even what that really means.

    Thank you, Wysota, once again for your help. You helped me a lot last time I had a problem and I want you to know I appreciate it.

  4. #4
    Join Date
    Jul 2009
    Posts
    7
    Thanks
    1
    Thanked 2 Times in 1 Post

    Default Re: QNetworkAccessManager get request causing QSslSocket errors

    Correction: File output working as expected. Still, must I compile OpenSsl support into Qt?

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default

    Please check if QNetworkAccessManager::sslErrors() signal gets emitted.

    Quote Originally Posted by Runtime Technologies View Post
    Correction: File output working as expected. Still, must I compile OpenSsl support into Qt?
    If everything works fine then no.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Jul 2009
    Posts
    7
    Thanks
    1
    Thanked 2 Times in 1 Post

    Default Re: QNetworkAccessManager get request causing QSslSocket errors

    No ssl errors emitted.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.