0

I am working on an ESRI AppStudio 3.1 app developed in Qt 5.11.2 and QML. I want to run my app in Qt Creator and be able to preview it with the qmlscene tool. I followed the steps ESRI provides to set this up and it has been working fine. However, we just added functionality to make a XMLHttpRequest via JavaScript to an API over HTTPS. This works when launching the app via the AppStudio AppRun.exe tool (Qt Creator Tools menu > External > AppStudio > Run) but does not work in qmlscene. I get the following console errors when trying to make the HTTPS call:

qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error

I found a number of people who had this problem with Qt apps and it was resolved by fixing OpenSSL .dlls references. This issue is pretty close: QSslSocket: cannot call unresolved function However, it deals with compiling a Qt app not running the qmlscene tool for an AppStudio app.

My project is set to run using the Desktop Qt 5.11.2 MSVC2017 64bit (msvc2017_64) kit and I have ensured that the libeay32.dll and ssleay32.dll files are present in C:\Qt\Qt5.11.2\5.11.2\msvc2017_64\bin. I have verified that QtCreator is launching qmlscene from C:\Qt\Qt5.11.2\5.11.2\msvc2017_64\bin\qmlscene.exe. How do I get the network requests to work?

Chris
  • 1,978
  • 3
  • 23
  • 35

1 Answers1

0

Somewhere in my research on this error I saw that this can be caused by the wrong versions of the OpenSSL libraries being used. I copied

%USERPROFILE%\Applications\ArcGIS\AppStudio\bin\libeay32.dll 
%USERPROFILE%\Applications\ArcGIS\AppStudio\bin\ssleay32.dll 

into C:\Qt\Qt5.11.2\5.11.2\msvc2017_64\bin to replace the ones that were there (I am not sure if they were there from the start or if I added them after downloading them from the OpenSSL website). This resolved my issue!

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Chris
  • 1,978
  • 3
  • 23
  • 35