Results 1 to 3 of 3

Thread: [SOLVED] Problem with windows 7 - Error Creating SSL Context

  1. #1
    Join Date
    Jan 2011
    Location
    Gordion
    Posts
    52
    Thanks
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Question [SOLVED] Problem with windows 7 - Error Creating SSL Context

    Hi all. i have a function that uses qnetworkaccessmanager to send and receive files.

    File sending.
    Qt Code:
    1. ....
    2. QNetworkRequest req;
    3. req.setUrl(QUrl("https://192.168.2.1/input.php"));
    4. req.setRawHeader("Content-Type", "multipart/form-data; boundary=" + boundary);
    5. QNetworkAccessManager *manager = new QNetworkAccessManager;
    6.  
    7. incoming= new QFile("file.xml");
    8. incoming->open(QIODevice::WriteOnly);
    9.  
    10. connect(manager,SIGNAL(finished(QNetworkReply*)),this,SLOT(filesenderror(QNetworkReply*)));
    11. reply2 =manager->post(req,datas);
    12. connect(reply2,SIGNAL(readyRead()),this,SLOT(readfile()));
    13. connect(reply2,SIGNAL(finished()),this,SLOT(writefile()));
    14. connect(reply2,SIGNAL(finished()),incoming,SLOT(deleteLater()));
    15. connect(reply2,SIGNAL(finished()),manager,SLOT(deleteLater()));
    16. reply2->ignoreSslErrors();
    17. reply2->request();
    18. ....
    To copy to clipboard, switch view to plain text mode 

    Error handling
    Qt Code:
    1. void MainWindow::filesenderror(QNetworkReply *reple)
    2. {
    3. if (reple->error() !=0)
    4. {
    5. if (reple->error() == 1 )
    6. {
    7. QMessageBox::critical(this,"Connection Problem", "Connection Refused");
    8. return;
    9. }
    10.  
    11. else
    12. {
    13. QMessageBox::critical(this,"Connection Problem",reple->errorString());
    14. return;
    15. }
    16. }
    17. else
    18. {
    19. ui->label_13->setText("Download progress complete");
    20. }
    21. }
    To copy to clipboard, switch view to plain text mode 

    I'm developing on windows vista. Everything is running clearly on vista machines. But on windows 7, its returning ssl error that "Error Creating SSL Context".

    I added Microsoft VC++ Redist packages to my inno setup file.

    vcredist_x86.21022
    vcredist_x86.30729.1
    vcredist_x86.30729.17

    Any ideas ? Am i missing something for windows 7 machines...

    Regards.

    --------------------------------

    i copied openssl files, libeay32.dll and ssleay32.dll to application directory and problem solved.
    Last edited by kosasker; 15th July 2011 at 14:41.

  2. The following user says thank you to kosasker for this useful post:

    dv8 (9th February 2013)

  3. #2
    Join Date
    Feb 2011
    Posts
    4
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: [SOLVED] Problem with windows 7 - Error Creating SSL Context

    Oh man, thank you very much. This was sooo annoying to debug. When making a QNetworkReply against an HTTPS address, it will silently fail with QNetworkReply::UnknownNetworkError and won't tell what's wrong.

  4. #3
    Join Date
    Jan 2013
    Posts
    13
    Thanks
    4

    Default Re: [SOLVED] Problem with windows 7 - Error Creating SSL Context

    I just can't thank you enough for sharing this solution!!!

Similar Threads

  1. Replies: 1
    Last Post: 11th April 2011, 14:17
  2. Replies: 0
    Last Post: 4th November 2010, 14:51
  3. Right-click context menus freeze on Windows
    By E099844 in forum Qt Programming
    Replies: 1
    Last Post: 25th October 2010, 17:35
  4. Error creating subclasses
    By agerlach in forum Qt Programming
    Replies: 2
    Last Post: 25th May 2010, 13:49
  5. Windows shell Context
    By ramazangirgin in forum Newbie
    Replies: 1
    Last Post: 18th July 2007, 11:58

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.