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. QNetworkAccessManager SSL display request content

QNetworkAccessManager SSL display request content

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 375 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.
  • A Offline
    A Offline
    Alex94102
    wrote on 17 Sept 2019, 03:23 last edited by
    #1

    Hello,

    does anyone knows how to display the raw content that is being sent to the server using let's say a GET or POST request via the QNetworkAccessManager? the traffic is encrypted and I cannot use a protocol analyzer. For some reason the server is complaining that it is missing some cookies, but I can pull the cookies and see that they are there. This code used to work before, and it stopped working, not sure where the issue is.

    I can see the cookie with this snippet of code:

      QList<QNetworkCookie> cs = mHttpHelper->getCookiesForUrl(url);
        qInfo() << "These are the cookies that we should are sending with this request:"<< url;
        foreach (QNetworkCookie c, cs ) {
            qInfo() << "cookieName="<< c.name()<<"="<<c.value();
        }
    

    but then if I print the raw headers:

    qDebug() << mNetworkRequest.url().toString();
    const QList<QByteArray>& rawHeaderList(mNetworkRequest.rawHeaderList());
     foreach (QByteArray rawHeader, rawHeaderList) {
       qDebug() << mNetworkRequest.rawHeader(rawHeader);
     }
    

    all it prints is these two lines (I changed the agent on purpose):
    "https://mytargetsite/blabla"
    "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"

    If I could display the content that gets submitted, then I could figure out what the problem is....

    Thank you!!

    A 1 Reply Last reply 17 Sept 2019, 03:56
    0
    • A Alex94102
      17 Sept 2019, 03:23

      Hello,

      does anyone knows how to display the raw content that is being sent to the server using let's say a GET or POST request via the QNetworkAccessManager? the traffic is encrypted and I cannot use a protocol analyzer. For some reason the server is complaining that it is missing some cookies, but I can pull the cookies and see that they are there. This code used to work before, and it stopped working, not sure where the issue is.

      I can see the cookie with this snippet of code:

        QList<QNetworkCookie> cs = mHttpHelper->getCookiesForUrl(url);
          qInfo() << "These are the cookies that we should are sending with this request:"<< url;
          foreach (QNetworkCookie c, cs ) {
              qInfo() << "cookieName="<< c.name()<<"="<<c.value();
          }
      

      but then if I print the raw headers:

      qDebug() << mNetworkRequest.url().toString();
      const QList<QByteArray>& rawHeaderList(mNetworkRequest.rawHeaderList());
       foreach (QByteArray rawHeader, rawHeaderList) {
         qDebug() << mNetworkRequest.rawHeader(rawHeader);
       }
      

      all it prints is these two lines (I changed the agent on purpose):
      "https://mytargetsite/blabla"
      "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"

      If I could display the content that gets submitted, then I could figure out what the problem is....

      Thank you!!

      A Offline
      A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on 17 Sept 2019, 03:56 last edited by
      #2

      Hi @alex94102, Wireshark can decode SSL content, just google for it.

      Regards

      Qt has to stay free or it will die.

      A 1 Reply Last reply 18 Sept 2019, 14:00
      0
      • A Offline
        A Offline
        Alex94102
        wrote on 17 Sept 2019, 14:23 last edited by
        #3
        This post is deleted!
        A 1 Reply Last reply 17 Sept 2019, 14:27
        0
        • A Alex94102
          17 Sept 2019, 14:23

          This post is deleted!

          A Offline
          A Offline
          Alex94102
          wrote on 17 Sept 2019, 14:27 last edited by
          #4
          This post is deleted!
          1 Reply Last reply
          0
          • A aha_1980
            17 Sept 2019, 03:56

            Hi @alex94102, Wireshark can decode SSL content, just google for it.

            Regards

            A Offline
            A Offline
            Alex94102
            wrote on 18 Sept 2019, 14:00 last edited by
            #5

            @aha_1980 I want to be able to visualize the request from the QT site, there should be no reason why that shouldn't be available. Also SSL traffic cannot be decrypted unless you get a hold of the key. That would be a different problem that I shouldn't have to get into. Reasonable?

            1 Reply Last reply
            0

            1/5

            17 Sept 2019, 03:23

            • Login

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