Archive 17/01/2023.

HttpRequest - HTTPS support

Miegamicis

Does anyone know how to get the HTTPS requests work in the engine? For now HttpRequest only support HTTP requests, HTTPS request fail with the message “SSL is not initialized”. Documentation is a bit scarse and cover mostly the web server part.

weitjong

Although the underlying 3rd-party lib (Civetweb) supports SSL, however, we don’t use the original CMakeLists.txt from the upstream. So, there is no way we can enable the SSL build option at the moment (unless you hack your way in and make the necessary changes).

Miegamicis

Already tried few options, none of them worked. Maybe while I’m at it it’s worth updating the civetweb too, as I checked, current version is from 2015.

weitjong

Yes. That would be great. As I understand it, the lib itself depends on OpenSSL library. So the build system needs to be adjusted as well to pull in the deps.

Miegamicis

I got so far that my implementation is now working on unix systems which by default comes with the openssl, as far as I know. But I’m having difficulty with the MinGW builds. What would be the best way to pull in OpenSSL dependency for these builds? Prebuilt Urho3D repository for openssl? Prebuilt Docker image?

Also I still have to test this with Visual Studio builds, I hope nothing unusual will pop out.

weitjong

Why don’t you just modify the http request demo and let the CI test it so you don’t need to perform this yourself.

Miegamicis

I already modified 43_HttpRequestDemo. CI completes without errors, but when making actual HTTPS request, error will be generated in the console:
ERROR: HttpRequest error: SSL is not initialized

weitjong

If you exit the app with an error status then the error should ripple back up to CI.

Miegamicis

It’s a silent error. So the app will not be terminated

Leith

I’m going to make an issue of this, I tend to use web connections in my games, and https is increasingly important, I don’t know anything about the issue (or issues) yet, but I just added it to my list.

Miegamicis

No need, there is already branch with my changes here which seem to work: https://github.com/urho3d/Urho3D/tree/civetweb-update

Will make PR a bit later

Leith

All good :wink: At least I can reserve my energy for other issues!