SSL errors in Qt Creator QmlScene [duplicate] - qt

This question already has answers here:
QSslSocket: cannot call unresolved function
(5 answers)
Closed 4 years ago.
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?

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!

Related

QSslSocket: cannot resolve SSLv2_server_method "Wkhtmltopdf " odoo

when i print my report i get this error , i don't know how to solve it
this is the error
Rapport (PDF
Wkhtmltopdf a échoué (code d'erreur : -11). Message : QSslSocket: cannot resolve SSLv2_client_method
QSslSocket: cannot resolve SSLv2_server_method
This error is reported on wkhtmltopdf repo:
https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1516
https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2431
Make sure you have ssl libs properly installed and that you are using the correct wkhtmltopdf version (should be 0.12.1 on odoo)
you need to remove the system entry parameters web.base.url you can find in the following menu
Settings --> Parameters --> System Parameters

(Qt 5.7) xcoder123/SimpleSmtp_SSL_QT5 giving errors

I've downloaded a project from github with the intension of learning SMTP and SSL. However, once i try to run his project, i receive the following errors:
"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"
error "QAbstractSocket::SocketError(21)"
"qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
"
"error QAbstractSocket::SocketError(20)"
The "AbstractSocket" Errors are:
SocketError(20): The SSL library being used reported an internal error. This is probably the result of a bad installation or misconfiguration of the library
SocketError(21): Invalid data (certificate, key, cypher, etc.) was provided and its use resulted in an error in the SSL library.
I know that for the project to work you need OpenSSL. But i think in Qt 5.7 it is a default library or something like it.
This is the page of the project.
Is there something I am missing? Do I need to install OpenSSL?
EDIT: I installed OpenSSL from This website. Its a pre-compiled version. Also, I moved the DLL's found in C:\OpenSSL - Win64 to my build folder

QTLocation: RouteModel Update Error Undefined

I am using QT 5.6.0 with Qtcreator 3.6.1 on ubuntu 14.04 LTS 64bits.
I am trying to Find a route from openstreetMap so I have a RouteModel and a RouteQuery.
I added waypoints to the Routequery, change the travelModes to RouteQuery.CarTravel and the routeOptimizations to RouteQuery.fastestRoute.
And then, I dit routeModel.update().
My problem is that the status change (onStatusChanged) to undefined error. First the status is ModelRoute.loading and then the status goes to RouteModel.Error. When I print the errorString, it is written as undefined.
So how can I correct the problem ? Is there a way to obtain more information about the error ?
If I look on the application output, I can see 2 warnings but I am not sure it is the cause :
qt.network.ssl: QSslSocket: cannot resolve SSLv2_client_method
qt.network.ssl: QSslSocket: cannot resolve SSLv2_server_method
Do you think it could be the cause of the error ? If Yes, how to correct it ?
I used an example from QT (mapviewer) and I have the same problem with it.
Thank you in advance for your answer.
openstreetmap routing in 5.6.0 is broken, due to OSRM.org having switched off their demo server based on the OSRMv4 protocol.
If you plan to use that software (5.6.0, osm plugin for routing), your only option is to find another open OSRMv4 server (or run your own), and set the plugin with a plugin parameter that specifies the URL of this server instead of using the hardcoded one.

Qt QWebView loading error linking some SSL libraries?

So i'm creating a mini browser with Qt and using QWebView. It loads some pages okay, but some of them have problems with SSL because i'm getting this errors:
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_CTX_new
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function ERR_get_error
I had previous issues with libraries and QTPlugins, and I haven't had any success in liking static plugins (more specifically image formats). I have no ideea how to solve these issues, as i am fairly new to QT framework.
This problem appears to be present only on Linux platforms, these plugins are not included somehow when you install QtCreator.
I have found no solution or documentation on this whatsoever.
However the problem does not appear on Windows, and QWebView works just fine for all functionalities.

LInker error when switching from windows to console

I am using Qt for GUI and building my project in waf.
For switching to windows subsystem from console(default) i had to pass this argument to the VS linker throught my wscript(waf)
subsystem='windows'
i added this in build part for waf file and I am getting this error
MSVCRT.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain#16 referenced in function ___tmainCRTStartup
C:\cygwin\home\sobingt\project\build\src\View\app.exe : fatal error LNK1120: 1 unresolved externals
I want to run this program as windows not as console.The Code works if i run it as console
subsystem='console'
You need to link against qtmain.lib (IIRC). This provides a shim around winmain which you need for windowed windows apps.

Resources