Problem with establishing a connection between Qt Https Server and browser.
-
Hi ! I spent few days trying to write HTTPS server because I need to decrypt data which are encrypted by the browser but I still have no results. This is what I did:
-
I created private key (2048 bytes) and self-signed certificate with openssl and put it into program.
-
In browser's settings I set SSL proxy using my IP and port (I tried IE, Firefox and Chrome)
When I'm trying to call some website, my program recognize a new connection but the function waitForEncrypted() returns me false and the browser refuse the connection. Does anybody have any idea what requirements I have to meet to establish a connection between browser and server in right way?
Signal sslErrors doesn't give me any information. It's not even called.
I'm using Windows 7 and openssl libraries: ssleay32.dll and libeay32.dll
Here's my code:
QSslConfiguration sslConfiguration; QFile certFile(":/server.crt"); QFile keyFile(":/server.key"); certFile.open(QIODevice::ReadOnly); keyFile.open(QIODevice::ReadOnly); QSslCertificate certificate(&certFile, QSsl::Pem); QSslKey sslKey(&keyFile, QSsl::Rsa, QSsl::Pem); sslConfiguration.setPeerVerifyMode(QSslSocket::VerifyNone); sslConfiguration.setLocalCertificate(certificate); sslConfiguration.setPrivateKey(sslKey); sslConfiguration.setProtocol(QSsl::TlsV1SslV3); sslSocket->startServerEncryption(); if (sslSocket->waitForEncrypted()) // false
-
-
@Dooms said:
sslConfiguration
You don't seem to have actually associated the sslConfiguration object with the QSslSocket object.
You can set the cert/key files directly on the QSslSocket if that helps simplify your code for testing...