Solved How to connect via API?
-
downloaded openssl-1.1.1b and put it in the folder with the executable file. Did not help.
In openssl-1.1.1b there is no libeay32.dll. -
There is a file e_os.h in the main folder of the library .
-
What version of Qt are you using ?
-
-
I use Qt 5.12.2
-
Then try again with the latest version of the 1.0 series.
-
I downloaded openssl-1.0.2r. There is no bin folder. No .exe files. No libeay32.dll. What to do with it?
-
I downloaded libeay32.dll ssleay32.dll and put them to the executable file and the project, but it still does not work.
-
Still the same error or another one ?
-
Same error: TLS initialization failed
-
Did you check whether you can connect to another https resource and if it triggers the same error ?
-
Not check. I don't know what other resource to connect to.
-
This post is deleted! -
How to fix this error?
-
@Mikeeeeee you may try a JSON testing site with secure connections, like https://jsonplaceholder.typicode.com
i.e. https://jsonplaceholder.typicode.com/todos/1 will return:
{ "userId": 1, "id": 1, "title": "delectus aut autem", "completed": false }
-
@Pablo-J.-Rogina said in How to connect via API?:
Tried to send to this address and got an old error.
-
And if you sent"http://json placeholder.typecode.com/todos/1" it works. Why https doesn't work?
-
Just to be sure add this to your code:
qDebug() << QSslSocket::supportsSsl(); qDebug() << QSslSocket::sslLibraryBuildVersionString(); qDebug() << QSslSocket::sslLibraryVersionString();
-
qDebug returns:
qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
false
"OpenSSL 1.0.2p 14 Aug 2018" -
Are you sure you put the OpenSSL 1.0 dlls in the right folder ? Without mixing them with another version of OpenSSL.