did you build Qt with OpenSSL?
did you build Qt with OpenSSL?
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
thanks for u r quick reply. i am using qt buitin example code for downloading files from server. it is downloading from some servers but for some urls it is showing message as unknown protocol. i knew that server has SSL and also authentication required. now i think problem is clear for u.
I suppose that you have build Qt by your own from source. So when doing this you have to clearly configure built for OpenSSL if you want to use QSsl* classes. Examples are also built on your system with your own Qt, so if you dont have SSL in your Qt build then SSL is not available in examples. And this is probably your case. So, as spirit said:
did you build Qt with OpenSSL?
I would like to be a "Guru"
Useful hints (try them before asking):
- Use Qt Assistant
- Search the forum
If you haven't found solution yet then create new topic with smart question.
yup, exactly.![]()
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
first of all, i don't know whether this is the solution for my problem or not. my problem is i am not able to download files from appache server which has SSL communicatio and i am able to downlaod files from some other servers. that's why i am asking Qssl may be prevent my problem. is it correct approach?
if server uses ssl connection then you have to use QSsl* classes and for using them you have to build Qt with OpenSSL.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Here is a part of httpwindow.cpp from Qt Examples:
Qt Code:
#ifndef QT_NO_OPENSSL void HttpWindow::sslErrors(const QList<QSslError> &errors) { QString errorString; foreach (const QSslError &error, errors) { if (!errorString.isEmpty()) errorString += ", "; errorString += error.errorString(); } tr("One or more SSL errors has occurred: %1").arg(errorString), http->ignoreSslErrors(); } } #endifTo copy to clipboard, switch view to plain text mode
as you see it's surrounded by
Qt Code:
#ifndef QT_NO_OPENSSL // . . . #endifTo copy to clipboard, switch view to plain text mode
so if you compile Qt without SSL support then this example still work but can't handle SSL connections (QT_NO_OPENSSL will be defined so that code would be, let's say, cut out). You said that you need to download files from server with SSL - and it's not working, but it's working for non-SSL connections, so the reason would be in QT_NO_OPENSSL is defined == Qt built without OpenSSL.
I would like to be a "Guru"
Useful hints (try them before asking):
- Use Qt Assistant
- Search the forum
If you haven't found solution yet then create new topic with smart question.
What's more, same thing you can see in qsslsocket.h:
Qt Code:
#ifndef QT_NO_OPENSSL class QDir; class QSslCipher; class QSslCertificate; class QSslConfiguration; class QSslSocketPrivate; { // . . . }; #endif // QT_NO_OPENSSLTo copy to clipboard, switch view to plain text mode
So there is no class QSslSocket if you didn't build your Qt with OpenSSL.
I would like to be a "Guru"
Useful hints (try them before asking):
- Use Qt Assistant
- Search the forum
If you haven't found solution yet then create new topic with smart question.
that mean if i build qt with openssl , can i download files from server with out change of http example program..(../qt/4.4.1/examples/network/http).
i am new to qt. could u plz tell me how to buid qt with openssl?
yes, there is no needed to change your example, just rebuild it.
there are to options how to build it:
-- download sources and then build them.
-- download www.openssl.org/related/binaries.html.
the second option is easier.
then all you need it's set environment variables for OpenSSL.
the next step -- you need to configure your Qt.SET LIB=D:\develop\OpenSSL\lib\VC;%LIB% -- if you use MS VS or
SET LIB=D:\develop\OpenSSL\lib\MinGW;%LIB% -- if you use MinGW
SET INCLUDE=D:\develop\OpenSSL\include;%INCLUDE%
there are to configure options:
I preferred then first option.-openssl ........... Compile in run-time OpenSSL support
-openssl-linked .... Compile in linked OpenSSL support
that's all.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
thank you very much, thanks a lot for u r great infromation. i'll try as u told
Hi,
Im also facing the similar problem from a couple of days. I want to set openssl support for qt 4.5 on winxp sp2 machine
I configured as
configure -openssl -I C:\OpenSSL\include\openssl -L C:\OpenSSL\lib\MinGW -webkit
then did mingw32-make
still i get errors when make is done on ssl folder of qt
meanwhile after configure is done, if i open makefile in C:\Qt\2009.01\qt, it still doest show openssl includes and libs i supplied with configure.
Im a newbie and im facing this issue for quite some time now.
Kindly let me know where im getting wrong. I followed the above mentioned steps (previous posts)
Please provide me exact steps of building qt 4.5 with openssl.
Thanks,
Srikanth
Hi,
Im also facing the similar problem from a couple of days. I want to set openssl support for qt 4.5 on winxp sp2 machine
I configured as
configure -openssl -I C:\OpenSSL\include\openssl -L C:\OpenSSL\lib\MinGW -webkit
then did mingw32-make
still i get errors when make is done on ssl folder of qt
meanwhile after configure is done, if i open makefile in C:\Qt\2009.01\qt, it still doest show openssl includes and libs i supplied with configure.
Im a newbie and im facing this issue for quite some time now.
Kindly let me know where im getting wrong. I followed the above mentioned steps (previous posts)
Please provide me exact steps of building qt 4.5 with openssl.
Thanks,
Srikanth
Bookmarks