Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to remove all Certificate Authorities certificates from a QNetworkRequest?

How to remove all Certificate Authorities certificates from a QNetworkRequest?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 484 Views 1 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.
  • A Offline
    A Offline
    Adnn
    wrote on last edited by
    #1

    Hello,

    We are trying to have complete control regarding which CA certificates a QNetworkRequest will be allowed to use. The first 'simple' test we wanted to run was to remove all CA certificates and make sure it triggers and error on any https attempt.

    Here is the minimal example showing how we set up the instances:

    QNetworkAccessManager manager;
    QUrl requestedUrl("https://www.google.com");
    QNetworkRequest request(requestedUrl);
    
    QSslConfiguration sslConfig = request.sslConfiguration();
    // Set the QList of certificates to an empty list
    sslConfig.setCaCertificates({});
    request.setSslConfiguration(sslConfig);
    
    QNetworkReply *reply = manager.get(request);
    connect(reply, SIGNAL(sslErrors(QList<QSslError>)),
            this, SLOT(slotSslErrors(QList<QSslError>)));
    

    We would expect that to fail at runtime: the request uses https scheme, and it intentionally does not have any CA certificates to complete the authentication. But the request actually completes successfully, the reply contains the webpage content, and the slotSslErrors slot is not executed.

    How would one actually disable all certificates for such a request ?

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi! That looks like QTBUG-13418.

      1 Reply Last reply
      2

      • Login

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