Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Qt webkit (webview) client certificate

    Qt WebKit
    3
    8
    2567
    Loading More Posts
    • 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
      borisa last edited by A Former User

      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 Reply Quote 0
      • K
        Konstantin Tokarev @borisa last edited by

        @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 Reply Quote 0
        • McLion
          McLion last edited by

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

          K 1 Reply Last reply Reply Quote 0
          • K
            Konstantin Tokarev @McLion last edited by 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()

            McLion 1 Reply Last reply Reply Quote 0
            • B
              borisa last edited by

              Hi,

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

              1 Reply Last reply Reply Quote 0
              • K
                Konstantin Tokarev last edited by

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

                1 Reply Last reply Reply Quote 0
                • McLion
                  McLion @Konstantin Tokarev last edited by

                  @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 Reply Quote 0
                  • K
                    Konstantin Tokarev last edited by

                    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 Reply Quote 1
                    • First post
                      Last post