Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. Qt webkit (webview) client certificate
QtWS25 Last Chance

Qt webkit (webview) client certificate

Scheduled Pinned Locked Moved Qt WebKit
8 Posts 3 Posters 3.3k 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.
  • B Offline
    B Offline
    borisa
    wrote on last edited by A Former User
    #1

    Hi,

    Qt-5.7
    QtWebkit 5.7
    Windows.

    I am trying to connect to site that requires a client certificate, I have it.
    How can I check before inject this key to the QsslConfiguration, that this site requires a client certificate?
    Is their event for it or access to connection packages?
    The sslErrors(QNetworkReply *reply, const QList<QSslError> &errors) signal in the QNetworkAccessManager doesnt help.

    In the Wireshark i see "Certificate request".
    Thx

    K 1 Reply Last reply
    0
    • B borisa

      Hi,

      Qt-5.7
      QtWebkit 5.7
      Windows.

      I am trying to connect to site that requires a client certificate, I have it.
      How can I check before inject this key to the QsslConfiguration, that this site requires a client certificate?
      Is their event for it or access to connection packages?
      The sslErrors(QNetworkReply *reply, const QList<QSslError> &errors) signal in the QNetworkAccessManager doesnt help.

      In the Wireshark i see "Certificate request".
      Thx

      K Offline
      K Offline
      Konstantin Tokarev
      wrote on last edited by
      #2

      @borisa said in QT webkit (webview) client certificate:

      Hi,

      QT-5.7
      QtWebkit 5.7
      Windows.

      I am trying to connect to site that requires a client certificate, I have it.
      How can I check before inject this key to the QsslConfiguration, that this site requires a client certificate?
      Is their event for it or access to connection packages?
      The sslErrors(QNetworkReply *reply, const QList<QSslError> &errors) signal in the QNetworkAccessManager doesnt help.

      In the Wireshark i see "Certificate request".
      Thx

      You should add client certificate and its key to your QSslConfiguration before starting connection.

      AFAIK it's not possible to adjust client key setting in responce to server requests with Qt now.

      1 Reply Last reply
      0
      • McLionM Offline
        McLionM Offline
        McLion
        wrote on last edited by
        #3

        Look at QSslSocket::addDefaultCaCertificates() http://doc.qt.io/qt-5/qsslsocket.html

        K 1 Reply Last reply
        0
        • McLionM McLion

          Look at QSslSocket::addDefaultCaCertificates() http://doc.qt.io/qt-5/qsslsocket.html

          K Offline
          K Offline
          Konstantin Tokarev
          wrote on last edited by Konstantin Tokarev
          #4

          @McLion said in QT webkit (webview) client certificate:

          addDefaultCaCertificates

          It has nothing to do with client certificates

          What is really needed here are QSslConfiguration::setLocalCertificate() and QSslConfiguration::setPrivateKey()

          McLionM 1 Reply Last reply
          0
          • B Offline
            B Offline
            borisa
            wrote on last edited by
            #5

            Hi,

            I just want to know if server requires a client certificate.
            Is there a way?

            1 Reply Last reply
            0
            • K Offline
              K Offline
              Konstantin Tokarev
              wrote on last edited by
              #6

              AFAIK no, you have to set up certificate and key unconditionally for all requests

              1 Reply Last reply
              0
              • K Konstantin Tokarev

                @McLion said in QT webkit (webview) client certificate:

                addDefaultCaCertificates

                It has nothing to do with client certificates

                What is really needed here are QSslConfiguration::setLocalCertificate() and QSslConfiguration::setPrivateKey()

                McLionM Offline
                McLionM Offline
                McLion
                wrote on last edited by
                #7

                @Konstantin-Tokarev
                On my eLinux system, I can surf every https as soon as I add the CA and make sure the date/time is set correctly.
                Of course, if a special one is needed this one should be added.

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  Konstantin Tokarev
                  wrote on last edited by
                  #8

                  CA certificates need to be added for 2 purposes:

                  • Your system does not have CA bundle in a place that can be automatically discovered by Qt, so you have to provide it manually
                  • You need to access servers with certificates signed by your own CA or some other CA which is not validated by one of "well-known" CA's included in such bundles
                  1 Reply Last reply
                  1

                  • Login

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