I am using Qt 4.5.2 now and am having some problem downloading date via HTTPS.
Here are what I do:
...
class A
{
static QSslConfiguration m_sconfig;
}
A::Start()
{
m_sconfig.setProtocol( QSsl::AnyProtocol );
QSslConfiguration::setDefaultConfiguration(m_sconf ig);
...
connect(&m_http, SIGNAL(readyRead(const QHttpResponseHeader &)), this, SLOT(readData(const QHttpResponseHeader &)));
connect(&m_http, SIGNAL(requestFinished(int, bool)), this, SLOT(finished(int, bool)));
connect(&m_http, SIGNAL(responseHeaderReceived(const QHttpResponseHeader &)), this, SLOT(readResponseHeader(const QHttpResponseHeader &)));
connect(&m_http, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(handleSslErrors(const QList<QSslError> &)));
QHttp::ConnectionMode mode = url->scheme().toLower() == "https" ? QHttp::ConnectionModeHttps : QHttp::ConnectionModeHttp;
// This works fine.
m_http.setHost("MyHost", mode, url->port() == -1 ? 0 : url->port());
// This results in a "HTTP request failed" error.
_id = m_http.get(""Relative_Path_on_Server");
...
}
The readResponseHeader(const QHttpResponseHeader &responseHeader) function was never called. So it seemed the HTTPS request was never sent out to the server.
If I switched to HTTP, all worked fine.
What am I missing?
I think this worked with Qt 4.4.3 as far as I remember.
Thanks in advance for any help.
By the way, I am using the commercial version of Qt and I was told that the OpenSsl support is built in.
And I debugged the Qt source and got the following error:
"Invalid or empty cipher list (error:1410D0B9:SSL routines:SSL_CTX_set_cipher_list:no cipher match)"
_____
Danny
Bookmarks