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. QSslSocket: cannot resolve TLSv1_1_client_method - for windows desktop application
Forum Updated to NodeBB v4.3 + New Features

QSslSocket: cannot resolve TLSv1_1_client_method - for windows desktop application

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 17.8k 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
    Abin
    wrote on last edited by
    #1

    I get the below error when I use GET of QNetworkAccessManager:

    @void ItemObjectAPI::getRequest (const QString &urlString)
    {
    QUrl url (BaseUrl + urlString);
    QNetworkRequest req (url);
    m_NetworkAccessManager.get (req);
    }@

    QSslSocket: cannot resolve TLSv1_1_client_method
    QSslSocket: cannot resolve TLSv1_2_client_method
    QSslSocket: cannot resolve TLSv1_1_server_method
    QSslSocket: cannot resolve TLSv1_2_server_method
    (Internal error: pc 0x1 in read in psymtab, but not in symtab.)
    (Internal error: pc 0x0 in read in psymtab, but not in symtab.)
    Debugging has finished

    Im using Qt5, windows 8 32 bit OS pc. How to resolve this?

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi, welcome to devnet.

      These might be two different problems I think. But to be sure let's first take care of the SSL stuff.
      Are those QSslSocket messages errors or just warnings? Do you have "OpenSSL":http://slproweb.com/products/Win32OpenSSL.html installed and dlls placed in your app directory or somewhere system wide?

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Abin
        wrote on last edited by
        #3

        Hi,
        I am debugging from the qtcreator. I'm not sure if they are errors or not.. but the debugging goes to "moc_mainwindow.cpp"

        @void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
        {
        if (_c == QMetaObject::InvokeMetaMethod) {
        MainWindow *_t = static_cast<MainWindow *>(_o);
        switch (_id) {
        case 0: _t->callGetRequest(); break;
        case 1: _t->displayItem((reinterpret_cast< QByteArray()>(_a[1]))); break;
        default: ;
        }
        }
        }@

        and from there to "Disassembler(QMetaObject::active)"

        @0x6b946890 <+0x059a> mov 0x6bcb89f0,

        and again.. why I need to install OpenSSL?

        1 Reply Last reply
        0
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          It depends on the urls you're going to use. https:// links use SSL, which Qt supports but doesn't distribute libraries for.

          My guess is your BaseUrl url is a https:// link. Is that right?

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Abin
            wrote on last edited by
            #5

            http://localhost/x/y/ - is my BaseUrl. So if I am building this application for an android device, how can i install OpenSSL?? Do I have to install it on each machine I am using my application???

            1 Reply Last reply
            0
            • Chris KawaC Offline
              Chris KawaC Offline
              Chris Kawa
              Lifetime Qt Champion
              wrote on last edited by
              #6

              If you use OpenSSL then you need to distribute it with your app. Either tell user to install or bundle OenSSL installer with your app or even just copy dlls to your app directory (but check licensing first, I'm not a lawyer). How it works on android I don't know,.

              But anyway, for http you don't need OpenSSL, so that's not the problem. As I said this might be something unrelated.

              Seems you have a bug somewhere in your code, but you'll have to give more details, like when it happens(at the start, when you do something specific) etc.
              Some code and a full callstack might be helpful too.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                Abin
                wrote on last edited by
                #7

                item.cpp

                @#include "item.h"
                #include <QJsonDocument>

                Item::Item (const QByteArray &jsonAsItem)
                {
                QJsonDocument jsonDocument = QJsonDocument::fromJson(jsonAsItem);
                QJsonObject jsonObject = jsonDocument.object();

                m_id        = jsonObject["id"].toInt();
                m_name      = jsonObject["name"].toString();
                m_price     = jsonObject["price"].toInt();
                m_isValid   = true;
                

                }

                int Item::id()
                {
                return m_id;
                }

                QString Item::name()
                {
                return m_name;
                }

                double Item::price()
                {
                return m_price;
                }

                bool Item::valid()
                {
                return m_isValid;
                }
                @

                itemobjectapi.cpp

                @#include "itemobjectapi.h"
                #include <QString>
                #include <QtCore/QtCore>

                const QString BaseUrl = "http://localhost/Checker/api/items/";

                ItemObjectAPI::ItemObjectAPI(QObject parent) :
                QObject (parent)
                {
                QObject::connect(&m_NetworkAccessManager, SIGNAL(finished(QNetworkReply
                )), this,
                SLOT(parseNetworkResponse(QNetworkReply*)));
                }

                void ItemObjectAPI::getRequest (const QString &urlString)
                {
                QUrl url (BaseUrl + urlString);
                QNetworkRequest req (url);
                m_NetworkAccessManager.get (req);
                }

                void ItemObjectAPI::parseNetworkResponse( QNetworkReply *finished )
                {
                if ( finished->error() != QNetworkReply::NoError )
                {
                // A communication error has occurred
                emit networkError( finished->error() );
                return;
                }

                // QNetworkReply is a QIODevice. So we read from it just like it was a file
                QByteArray data = finished->readAll();
                emit ItemRetrived (data);
                

                }
                @

                mainwindow.cpp

                @#include "mainwindow.h"
                #include "item.h"

                MainWindow::MainWindow(QWidget *parent)
                : QMainWindow(parent)
                {
                pMainWidget = new QWidget ();

                setCentralWidget(pMainWidget);
                
                
                button = new QPushButton("get data");
                textLine = new QLineEdit();
                output = new QLabel("output replaces me");
                
                layout = new QHBoxLayout(pMainWidget);
                pMainWidget->setLayout(layout);
                
                layout->addWidget(textLine);
                layout->addWidget(button);
                layout->addWidget(output);
                
                QObject::connect(button, SIGNAL(clicked()), this, SLOT(callGetRequest()));
                QObject::connect(&item_api, SIGNAL(ItemRetrived(QByteArray)), this, SLOT(displayItem(QByteArray)));
                

                }

                MainWindow::~MainWindow()
                {

                }

                void MainWindow::displayItem(QByteArray data)
                {
                Item item(data);
                textLine->setText(item.name()+" "+item.price());
                }

                void MainWindow::callGetRequest()
                {
                QString url = textLine->text();
                if (!(url.compare("")))
                {
                output->setText("Enter Item Number");
                }
                else
                {
                item_api.getRequest(url);
                }

                }
                @

                during debugging, in itemobjectapi.cpp after line 18, it is no idea how is it going the control... I have set break point at "parseNetworkResponse(QNetworkReply*)"

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  Abin
                  wrote on last edited by
                  #8

                  To Chris Kawa:

                  Thanks, the error in my application was the JSON object parameters I used to parse. It is case sensitive. I had to give it as
                  @m_id = jsonObject["Id"].toInt();
                  m_name = jsonObject["Name"].toString();
                  m_price = jsonObject["Price"].toInt();@

                  The app works. But still I gets the messages:
                  bq. QSslSocket: cannot resolve TLSv1_1_client_method
                  QSslSocket: cannot resolve TLSv1_2_client_method
                  QSslSocket: cannot resolve TLSv1_1_server_method
                  QSslSocket: cannot resolve TLSv1_2_server_method

                  I am just ignoring those, hoping they are not errors..

                  1 Reply Last reply
                  0

                  • Login

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