PDA

View Full Version : From QHttp to QHttp over SSL



Nyphel
21st June 2007, 15:42
Hello,

I was using the QHttp class under Qt4.2.3 to fill an anthentification form, get the response and the cookie value from the server (If well authentificated), and then to download a private page content.

The problem is that the page should be stored on a securised zone.
With Qt 4.3 - open source for Windows - we have a SSL support (QHttp with a QHttp::ConnectionModeHttps parameter, and sslSockets that use the openSSL library). So we have transfered our small web site under our securised area, and we woul like to access it like before...

Using QHttp connection, with the SSL mode activated and handling sslErrors, is causing me some troubles.

With Qhttp from Qt4.2.3 :


http = new QHttp(post_request_host, post_request_port);


With Qhttp over SSL from Qt3 :


http = new QHttp(post_request_host, QHttp::ConnectionModeHttps, post_request_port);


For each web page of our HTTPs area I try to download (using GET header) or to fill (using a POST header), the server answers me with a 302 redirection error code. The most funny is that some of thoses pages didn't contain any "referer" tag, and in most cases the redirectons information says me that the new place of the page is... the one I called.

I've tested with a copy of our old HTTP web site : I pasted it in the HTTPs area, and I can't used it simply indicating the QHttp::ConnectionModeHttps parameter. Is there something else to do ?

Should I compile Qt with the link to the openSSL library ?
I think that this library is used for the new sslSockets, derived from QTcpSockets, but I didn't find any reference to the QHttp class.

Thanks for your comments, ideas or suggestions :)

wysota
3rd July 2007, 10:41
Did you remember to connect to the proper port?