PDA

View Full Version : [SOLVED] Problem with windows 7 - Error Creating SSL Context



kosasker
15th July 2011, 14:02
Hi all. i have a function that uses qnetworkaccessmanager to send and receive files.

File sending.


....
QNetworkRequest req;
req.setUrl(QUrl("https://192.168.2.1/input.php"));
req.setRawHeader("Content-Type", "multipart/form-data; boundary=" + boundary);
QNetworkAccessManager *manager = new QNetworkAccessManager;

incoming= new QFile("file.xml");
incoming->open(QIODevice::WriteOnly);

connect(manager,SIGNAL(finished(QNetworkReply*)),t his,SLOT(filesenderror(QNetworkReply*)));
reply2 =manager->post(req,datas);
connect(reply2,SIGNAL(readyRead()),this,SLOT(readf ile()));
connect(reply2,SIGNAL(finished()),this,SLOT(writef ile()));
connect(reply2,SIGNAL(finished()),incoming,SLOT(de leteLater()));
connect(reply2,SIGNAL(finished()),manager,SLOT(del eteLater()));
reply2->ignoreSslErrors();
reply2->request();
....


Error handling



void MainWindow::filesenderror(QNetworkReply *reple)
{
if (reple->error() !=0)
{
if (reple->error() == 1 )
{
QMessageBox::critical(this,"Connection Problem", "Connection Refused");
return;
}

else
{
QMessageBox::critical(this,"Connection Problem",reple->errorString());
return;
}
}
else
{
ui->label_13->setText("Download progress complete");
}
}


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.

sztomi
4th February 2012, 17:09
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.

dv8
9th February 2013, 23:56
I just can't thank you enough for sharing this solution!!! :)