Unsolved TLS initialization failed during API call?
-
Apologies I thought 4.8 was the version, that's just what it shows when I open it. I installed 5.12.0.
I recently downloaded openssl-1.0,2a-win32-mingw so I have OpenSSL downloaded.
-
No, that's the Qt Creator version which is unrelated to the Qt version you are using to build your application.
IIRC, Qt 5,12 is using OpenSSL 1.1. The OpenSSL 1.1 series is not backward compatible with the OpenSSL 1.0 series.
-
Ok so Qt 5.12.
Currently I have no OpenSSL from before 1.1 attached to the project though. I have 1.0.2 in my downloads but it currently is not associated with Qt or the project. Knowing this and seeing the code, any idea how to fix the error? -
Download OpenSSL 1.1 and then in the Run part of the Project panel, modify the PATH environnement variable and add the folder where the OpenSSL .dll files can be found.
-
@SGaist My I ask how to actually do that? I have the file in C:/OpenSSL-Win64 but I'm not sure where to exactly add it or insert it? I don't see an explicit PATH environment variable that this could be added to, or at least if I do see it I'm unsure if it is it.
-
@ckzaner Did you check the Run settings as @SGaist suggested?
I'm pretty sure you have PATH variable under "Run Environment" there.
So, click on "Projects" at the left side in QtCreator and select "Run" in the Kit you're using and then expand "Run Environment".
You need to add the path containing OpenSSL libraries to PATH there. -
Ok so I went from Projects--->Run (on left side underneath Build)
There is not anything explicitly called the PATH environment or anything like that.
There is the section under Run which shows me the Run Configuration which shows my current directory for the project.
Would I select "add" here and then give the directions to the OpenSSL-Win64 file?Edit::: @jsulm Actually at the bottom there is a Run Environment section. I'll see if I do this right.
I'm assuming select add, name it opensslv1.1, then give path to the libs folder and that's it? -
@jsulm So I have this in the Run Environment now.
I assume there's more to be done?
I still get the same error "qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed" -
-
@jsulm I found "Path". Maybe I need to change something else?
This is the value now:
C:\Qt\Tools\mingw730_64\bin;C:\Qt\5.12.0\mingw73_64\bin;C:\Qt\Tools\mingw730_64\bin;C:\OpenSSL-Win64\bin;C:\Windows\system32;......(so on so forth).The bin has all the .dll folders. Not sure if Qt is using them though. I used the line:
qDebug() <<"ssl:" << QSslSocket::sslLibraryBuildVersionString();
to try and see if Qt was using it but it says OpenSSL 1.0.2p -
Ok, then in that case, point it to the OpenSSL 1.0 you installed on your machine.
-
This post is deleted!