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

qtnetwork doesn't load the default system ca bundle on ubuntu

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 6.5.5
    • Network: SSL
    • Ubuntu 22.04.3, kernel 6.5.0-26-generic
    • Linux/Wayland

    Description

      We have a self-signed ca certificate installed in Windows, macOS and Ubuntu, on Ubuntu the self-signed ca cert is install in /etc/ssl/certs/ca-certificates.crt.

      These code snippet below works fine on both Windows and macOS, but doesn't work on Ubuntu 22.04.3 with kernel 6.5.0-26-generic. In order to work for Ubuntu, it have to load the ca bundle usingĀ  QSslCertificate::fromPath, and set a new QSslConfiguration for QNetworkRequest.

      m_url = "https://self-signed-https-domain/path"
      QNetworkRequest request(m_url);
      // uncomments these 4 lines below on Ubuntu
      //QList<QSslCertificate> certs = QSslCertificate::fromPath("/etc/ssl/certs/ca-certificates.crt");
      //QSslConfiguration config = QSslConfiguration();
      //config.addCaCertificates(certs);
      //request.setSslConfiguration(config);
      m_reply = manager->post(request, params.toUtf8());

      The QSslConfiguration::defaultConfiguration() method doesn't load the default system ca bundle too.

      Attachments

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

        Activity

          People

            tpochep Timur Pocheptsov
            shengyuan IT QT01
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes