简体   繁体   中英

SSL handshake failed when trying to run https code from c++

I am trying to use a c++ app to access a php script on a different computer. The script queries a mysql database and outputs the values. When accessing https://myaddress/script.php in my web browser, it gives me the "The site's security certificate is not trusted!" page, then allows me to Proceed Anyway. I expected that, and it is ok because I have not yet jumped through the hoops to get my certificate certified.

However, when I try to access the same site from within my c++ app using QNetworkAccessManager, it tells me that the SSL handshake failed and quits out.

Why is this a problem? Does it have something to do with the fact that my certificate hasn't been authenticated, or is it something else? Can I set a feature in Qt Creator that allows my code to access even not trusted sites?

Any guidance would be very helpful, Thanks in advance.

I had similar problem, I did two things:

  • re run/install Win32 OpenSSL Installation. Download the latest "light" Win32 or Win64 installation package, for example "Win32 OpenSSL v0.9.8l Light".
  • follow link here: http://developer.nokia.com/community/discussion/showthread.php/234276-Qt-SSL-handshake-failed

  • The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

     
    粤ICP备18138465号  © 2020-2024 STACKOOM.COM