Results 1 to 7 of 7

Thread: Qt 4.7 Https?

  1. #1
    Join Date
    Apr 2010
    Posts
    98
    Thanks
    19
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt 4.7 Https?

    I was sending request to "https://www.google.com/accounts/OAuthGetRequestToken" using QNetworkAccessManager.

    It used to work, but not until I update Qt to 4.7. Now I always get "QNetworkReply::SslHandshakeFailedError" when I try to send that request. And I have already had the openssl dlls inside my app's folder.

    How can I solve this problem? Thanks~
    It's not the goodbye that hurts,but the flashback that follow.

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Qt 4.7 Https?

    Quote Originally Posted by MorrisLiang View Post
    It used to work, but not until I update Qt to 4.7.
    You mean "until" and not "but not until" which means "!until" wich is the opposite of "until"

    Try this:
    Clean the build completely. What does that mean, completely? If you have a build dir, remove it. If you build in the source dir, only keep the source files, all generated files need to be removed. Make clean is not sufficient.
    Then rerun qmake and make again.

    Does this solve the problem?

  3. #3
    Join Date
    Apr 2010
    Posts
    98
    Thanks
    19
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt 4.7 Https?

    My bad,that grammar kinda confuse me... What I mean is, it works under Qt4.6, but not under 4.7..
    Thanks for the reply. Actually, I have dug a little deeper, I checked the QSslError in a slot connected to the QNetworkAccessManager's sslErrors() SIGNAL. The sslError saids that the cert has expired. So I checked the cert by calling QSslError::certificate(), which I found that the cert is Null... I think the manager didn't receive the cert at all...

    I have already built the 4.7 with the same configuration when I built 4.6:
    configure -fast -debug-and-release -opensource -openssl -I D:\Qt\OpenSSL-Win32\include -L D:\Qt\OpenSSL-Win32 -no-qt3support -no-webkit -no-scripttools -nomake examples -nomake demos -no-script -no-style-plastique -no-style-cleanlooks -no-style-motif -no-style-cde -nomake docs

    I think the configuration somehow didn't enabled the SSL support... Maybe I need to build the network module again with SSL enabled.
    It's not the goodbye that hurts,but the flashback that follow.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt 4.7 Https?

    Connect the sslErrors() signal to ignoreSslErrors() slot.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Apr 2010
    Posts
    98
    Thanks
    19
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt 4.7 Https?

    If I ignore the error, I can't open the google oauth authorize page...
    It's not the goodbye that hurts,but the flashback that follow.

  6. #6
    Join Date
    Apr 2010
    Posts
    98
    Thanks
    19
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt 4.7 Https?

    I get back to 4.6.2 finally...Maybe we should consider this is a bug or something in 4.7
    It's not the goodbye that hurts,but the flashback that follow.

  7. #7
    Join Date
    Jan 2010
    Posts
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt 4.7 Https?

    This is caused by the change in qt 4.7 where root certificates are not included in the qtnetwork module, where as earlier versions of qt shipped with a bundle of common root certificates. If you ensure that proper root certificates, more specifically the one(s) that are used by the host you are attempting to connect to, are installed on the system that you are running from this shouldn't be a problem.

    See, http://bugreports.qt.nokia.com/browse/QTBUG-12718 for more info

    connecting to the sslError slot and ignoring the ssl error should enable you to connect, although you cannot be sure of the identity of the host you are connecting to.

Similar Threads

  1. QNetworkAccessManager and https. help!
    By valerino in forum Qt Programming
    Replies: 0
    Last Post: 22nd July 2010, 14:13
  2. qtsoap - ssl errors for HTTPS
    By babymonsta in forum Qt Programming
    Replies: 11
    Last Post: 13th April 2010, 13:18
  3. QUrl and https
    By TomASS in forum Newbie
    Replies: 1
    Last Post: 15th March 2010, 22:49
  4. Https and windows
    By nicugh in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2009, 13:25
  5. Https POST Request
    By munna in forum Qt Programming
    Replies: 10
    Last Post: 11th November 2006, 14:24

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.