Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-2060

Modify the incomingConnection() sample in the documentation for QSslSocket

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • Some future release
    • 4.4.0
    • Documentation
    • None

    Description

      In QSslSocket documentation, \brief has the following sample:

      void SslServer::incomingConnection(int socketDescriptor)
      {
      QSslSocket *serverSocket = new QSslSocket;
      if (serverSocket->setSocketDescriptor(socketDescriptor))

      { connect(serverSocket, SIGNAL(encrypted()), this, SLOT(ready())); serverSocket->startServerEncryption(); }

      else

      { delete serverSocket; }


      }

      It doesn't work like that however, it requires to set the Certificate and Private Key first.

      The way the snippet is presented in the documentation, it just silently disconnects the client. It would also be useful to have a qWarning or qDebug somewhere that's stating that it's missing the certificate/private key.

      It would also be useful to have a documentation on how to generate a self signed certificate/key.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            dm Geir Vattekar
            sanonymous Nokia Qt Support (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes