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. QSslSocket behavior
Qt 6.11 is out! See what's new in the release blog

QSslSocket behavior

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.1k Views 1 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hello all,
    I'm having a very strange behavior with QSslSocket: I'm developing a client/server application over TCP (application protocol is proprietary). I'm using RSA for public key protocol used for authentication, AES-128 for symmetric cipher and SHA for hash.

    My protocol is using several ports: 2 of them are used for control (small messages, less than 150 chars most of the time), a last one is used for file transfer.

    Everything works fine as long as I'm using 4K length RSA keys.

    When decreasing RSA key length (1024/2048 instead of 4096), file transfer does not work any more. Small messages exchange on other ports is still ok though.

    When I'm saying that file transfer does not work, it means that onReadyRead() slot of QSslSocket is never called, not even once. I checked with Wireshark that data was actually sent and actually arrived on server, so issue is inside Qt itself.

    Any idea of what is going on ?

    Thanks in advance

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2
      • looks like onReadyRead() slot is not called while some data are available for reading: this looks like a Qt bug !
        For me it happened with Qt4.7.4, need to check if this may also happen with newer versions...

      A workaround consists in forcing 1st call to onReadyRead() slot after waiting for available bytes to be there:

      @
      while (!_socketClient->bytesAvailable())
      {
      QCoreApplication::processEvents();
      }

      onReadyRead();
      @

      Then for following data chunks, Qt fortunately calls onReadyRead() as expected...
      For information I'm on Windows 32-bits, but this may well happen also on Linux. To be checked also...

      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