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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 5.15.0
    • WebEngine
    • None
    • Windows

    Description

      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.

       

      Attachments

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

        Activity

          People

            qt_webengine_team Qt WebEngine Team
            zzm3145 zm z
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes