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

QWebEnginePage::selectClientCertificate() do not contain cert supplied in QWebEngineClientCertificateStore

XMLWordPrintable

    • Windows

      In simple browser example, 

      1. Use QSslCertificate::importPkcs12() to import client cert, and add to QWebEngineClientCertificateStore

      /browser.cpp
      BrowserWindow *Browser::createWindow(bool offTheRecord)
      {
          ...
          auto certStore = profile->clientCertificateStore();
          QFile keyFile("user.p12");
          if (keyFile.open(QIODevice::ReadOnly))
          {
              QSslKey client_key;
              QSslCertificate client_cert;
              if (QSslCertificate::importPkcs12(&keyFile, &client_key, &client_cert))
              {
                  certStore->add(client_cert, client_key);
              }
          }
         ...
      }

      2.  Check for the client cert in WebPage::handleSelectClientCertificate() slot.

      // webpage.cpp
      void WebPage::handleSelectClientCertificate(QWebEngineClientCertificateSelection selection)
      {
          for (auto& cert : selection.certificates())
          {
            ...
          }   
      }

      However only system client certs are in the selection.  And if I do not install any client cert to Windows system , the signal will not be emitted at all.

       

        1. qtbug86132.zip
          25 kB
          Irfan Omair
        2. profileOutput.txt
          6 kB
          Erik Bryan
        3. profileScreenshot.png
          22 kB
          Erik Bryan
        4. systemOutput.txt
          0.7 kB
          Erik Bryan
        5. systemScreenshot.png
          128 kB
          Erik Bryan
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            allan.jensen Allan Sandfeld Jensen
            zzm3145 zm z
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                There is 1 open Gerrit change