PDA

View Full Version : qtsoap - ssl errors for HTTPS



babymonsta
9th April 2010, 10:06
Im using the open source edition of QtSoap and Im able to send a soap message and get the response to a HTTP, but it doesn't work on HTTPS and it gives me the error of:

QSslSocket: cannot call unresolved function SSLv3_client_metho
QSslSocket: cannot call unresolved function SSL_CTX_new
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function ERR_get_error
QSslSocket: cannot call unresolved function ERR_error_string

And the soap message reply was:

Network transport error (99): Error creating SSL context ()

Im running on Windows7 and my qtcreator version is 4.6.0. I tried searching the internet and I followed their method of installing openSSL and including the libeay32.dll and ssleay32.dll into my project folder and also in the Qt bin folder. I'm not sure where I went wrong, so any advice would be good, thanks

P.S I'm using QtSoapHttpTransport

wysota
9th April 2010, 10:26
Is your Qt built with SSL support at all?

babymonsta
9th April 2010, 11:03
I tried following this link http://greensoftware.net/blog/2009/12/01/compiling-qt4-6-with-openssl-support-on-windows-with-mingw/ and Ive already downloaded and installed opensll from http://www.slproweb.com/products/Win32OpenSSL.html but when I tried to re-build my Qt following the steps from the 1st link, it gave a ton of errors related to SSL. So I'm not sure where I went wrong..

wysota
9th April 2010, 22:10
Could you quote the first few errors?

babymonsta
11th April 2010, 08:50
Here's is a fragment of the error I got after running mingw32-make

ssl\qsslsocket_openssl_symbols_p.h:293: error: 'SSL' was not declared in this scope
ssl\qsslsocket_openssl_symbols_p.h:293: error: 'a' was not declared in this scope
ssl\qsslcertificate.cpp: In static member function 'static QSslCertificate QSslC
ertificatePrivate::QSslCertificate_from_X509(X509* )':
ssl\qsslcertificate.cpp:687: error: 'ASN1_TIME' was not declared in this scope
ssl\qsslcertificate.cpp:687: error: 'nbef' was not declared in this scope
ssl\qsslcertificate.cpp:687: error: 'X509_get_notBefore' was not declared in this scope
ssl\qsslcertificate.cpp:688: error: 'naft' was not declared in this scope
ssl\qsslcertificate.cpp:688: error: 'X509_get_notAfter' was not declared in this scope
mingw32-make[2]: *** [tmp/obj/debug_shared/qsslcertificate.o] Error 1
mingw32-make[2]: Leaving directory `C:/Qt/2010.02.1/qt/src/network'
mingw32-make[1]: *** [debug-all] Error 2
mingw32-make[1]: Leaving directory `C:/Qt/2010.02.1/qt/src/network'
mingw32-make: *** [sub-network-make_default-ordered] Error 2

wysota
12th April 2010, 09:00
Do you have includes for the SSL library available where the compiler can find them?

babymonsta
12th April 2010, 12:17
I followed the example here http://greensoftware.net/blog/2009/1...ws-with-mingw/ and did the SET PATH and so on, doesn't that let the compiler know where to find the SSL library? Or where should I put the SSL library into? By default after I install OpenSSL, it appears on C:/OpenSsl and in SET PATH and so on, I put it to point to this folder..

wysota
12th April 2010, 12:49
The link is broken so it's hard to say what is sufficient :) But include files are not looked for in the PATH so it's probably safe to assume setting the PATH is not enough. You need to tell the Qt build process where to find OpenSSL. Run configure.exe with -help and read through the output.

babymonsta
13th April 2010, 08:24
Here is the link again http://greensoftware.net/blog/2009/12/01/compiling-qt4-6-with-openssl-support-on-windows-with-mingw/. It says to type in

SET LIB=c:\openssl\lib\mingw;%LIB%
SET INCLUDE=c:\openssl\include;%INCLUDE%
SET PATH=c:\openssl;%PATH%

Am I supposed to type in exactly %LIB% or am I supposed to type in %LIB% with something else after it?

wysota
13th April 2010, 10:36
Type in what they said to type in.

babymonsta
13th April 2010, 11:48
I did, but I still got the same error I mentioned some posts earlier..I think its because the https is asking for the ssl certificate add exception part and my soap message can't go through because of this?

wysota
13th April 2010, 14:18
But did you rebuild Qt after typing those lines?