Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problem with establishing a connection between Qt Https Server and browser.
QtWS25 Last Chance

Problem with establishing a connection between Qt Https Server and browser.

Scheduled Pinned Locked Moved General and Desktop
httpsserverbrowserqt5windowsopensslqsslsocketqsslcertificate
2 Posts 2 Posters 1.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dooms
    wrote on last edited by
    #1

    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
    
    1 Reply Last reply
    0
    • D Offline
      D Offline
      davidgyates
      wrote on last edited by
      #2

      @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...

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved