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
Forum Updated to NodeBB v4.3 + New Features

Qt webkit (webview) client certificate

Scheduled Pinned Locked Moved Qt WebKit
8 Posts 3 Posters 3.4k Views 2 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.
  • B Offline
    B Offline
    borisa
    wrote on 28 Nov 2016, 15:35 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 28 Nov 2016, 15:53
    0
    • B borisa
      28 Nov 2016, 15:35

      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 28 Nov 2016, 15:53 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
      • M Offline
        M Offline
        McLion
        wrote on 28 Nov 2016, 15:58 last edited by
        #3

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

        K 1 Reply Last reply 28 Nov 2016, 16:04
        0
        • M McLion
          28 Nov 2016, 15:58

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

          K Offline
          K Offline
          Konstantin Tokarev
          wrote on 28 Nov 2016, 16:04 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()

          M 1 Reply Last reply 28 Nov 2016, 16:14
          0
          • B Offline
            B Offline
            borisa
            wrote on 28 Nov 2016, 16:11 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 28 Nov 2016, 16:14 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
                28 Nov 2016, 16:04

                @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()

                M Offline
                M Offline
                McLion
                wrote on 28 Nov 2016, 16:14 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 28 Nov 2016, 16:17 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

                  2/8

                  28 Nov 2016, 15:53

                  topic:navigator.unread, 6
                  • Login

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