HTTPS requests not working on Android

Hi,
HTTPS requests not working on Android… For example works but doesn’t work…
Anyone know how to resolve this?

Thank you.

I called Response.IsValid() and it returns false so Reponse is not valid…

In the Project Settings dialog, look in the Engine - Network section for Libcurl Verify Peer checkbox. Try turning it off and see if it works.

I had same problem.

I used my own certification which works fine with Libcurl-Verify-Peer option off.

But in Android, I had following logs with console ‘log loghttp all’

'SSL: certificate subject name ‘<some name>’ does not match target host name ‘<requested url>’

I googled it and solved by putting following codes

curl_easy_setopt(EasyHandle, CURLOPT_SSL_VERIFYHOST, 0L);

just after

curl_easy_setopt(EasyHandle, CURLOPT_SSL_VERIFYPEER, 0L); at the FCurlHttpRequest::FCurlHttpRequest()

You don’t need to do this in 4.11 anymore. Android now registers a PEM file with certificates. At startup it checks if it has already generated a PEM file, if not, it either uses an override ca-bundle.pem from your project’s Content/CurlCertificates directory (add this as a non-asset directory in Packaging project settings), or it will generate one from the contents of /system/etc/security/cacerts and add any optional certificates from Content/CurlCertificates/ca-additions.pem if provided. The code for this is in FCurlHttpManager::InitCurl().

1 Like

Thanks a lot !