Results 1 to 7 of 7

Thread: need help with posting tweets HTTPS request with ssl

  1. #1
    Join Date
    Sep 2015
    Posts
    5
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Smile need help with posting tweets HTTPS request with ssl

    Hi,
    I'm an intern at an IT frim and my first duty is to make an console app that sends tweets. I successfully created my header and right now I can sent my HTTPS posts with the header I created . But having an authroization problem altough I'm sure I have correct token and secret values. So I made a research and I found information in this site that says I should use cipher and certificates. My question is since I already installed openssl(havent written any extra code for it but ot having any ssl errors) should I do anything extra and if I should could you please show me how to add cipher(rc4) and certificate(cacert.pem I guess) to my request.

    I found about sslsocket but can I add query and http header to it?

    Here is the code :
    Qt Code:
    1. QNetworkRequest request(url);// url is "https://api.twitter.com/1.1/statuses/update.json"
    2. request.setRawHeader(O2_HTTP_AUTHORIZATION_HEADER, buildAuthorizationHeader(oauthParams));
    3. request.setHeader(QNetworkRequest::ContentTypeHeader, O2_MIME_TYPE_XFORM);
    4. // manager->post(request, postData);
    To copy to clipboard, switch view to plain text mode 

    note: my requests seems right since I can do the pin and token gathering processes

    thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,420
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: need help with posting tweets HTTPS request with ssl


  3. The following user says thank you to anda_skoa for this useful post:

    k1447321 (3rd September 2015)

  4. #3
    Join Date
    Sep 2015
    Posts
    5
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: need help with posting tweets HTTPS request with ssl

    hey,
    thank you for your suggestion I added an cacert and cipher using the info you gave my cipher is rc4-sha and my cacert is from this site and is called Class 3 PKI Key Intermediate Certificate (PEM Format). but now I'm having
    Qt Code:
    1. http status: 0
    To copy to clipboard, switch view to plain text mode 
    . do you people any idea about this?

  5. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,592
    Thanks
    13
    Thanked 1,587 Times in 1,516 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: need help with posting tweets HTTPS request with ssl

    Where are you getting the value zero from?

    Zero from QNetworkReply::error() is no errror.

  6. #5
    Join Date
    Sep 2015
    Posts
    5
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: need help with posting tweets HTTPS request with ssl

    I'm sending my post to the twitter api and I get an http status code 0 from there. I used to get codes like 401 not authorized but now all I get is http status code 0. I added cipher(rc4-sha) ,certificate(cacert) , and protocol(sslv3) but still having the same problem
    thanks anyway

  7. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,592
    Thanks
    13
    Thanked 1,587 Times in 1,516 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: need help with posting tweets HTTPS request with ssl

    What is the raw text of the entire response? Are there valid HTTP headers or just a dropped connection?
    Ensure that the form of your POST body is correct.

    Have you tried putting Fiddler between your application and the Twit servers to observe the raw interaction? (Yes, it can MITM your SSL)

  8. #7
    Join Date
    Sep 2015
    Posts
    5
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: need help with posting tweets HTTPS request with ssl

    Qt Code:
    1. ""
    2. http status: 0
    To copy to clipboard, switch view to plain text mode 
    this is the reply I get from twitter. this happens at the last (posting tweet) phase. other than that receiving replies from twitter works and I can get my oauth data. my request is correct atleast the headers and the body since it works perfectly with the cUrl. my problem is I still dont know how to send a post with ssl. as far as I know I need to include cacert.pem and make handshake with the host. If you can help me with a working https post or a libcurl implementation that would be great.

Similar Threads

  1. Replies: 3
    Last Post: 11th March 2015, 11:56
  2. HTTPS request returns damaged HTML body
    By ljuhrich in forum Qt Programming
    Replies: 6
    Last Post: 2nd June 2013, 08:37
  3. Replies: 0
    Last Post: 3rd May 2011, 09:15
  4. Request ID of QNetworkaccessmanager get and post request
    By dineshkumar in forum Qt Programming
    Replies: 2
    Last Post: 4th February 2011, 21:56
  5. Https POST Request
    By munna in forum Qt Programming
    Replies: 10
    Last Post: 11th November 2006, 14:24

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.