TheGameCreators / AGK-Studio

3 stars 1 forks source link

SetHTTPVerifyCertificate not working? #1117

Open JohnStabler opened 7 months ago

JohnStabler commented 7 months ago

I have a web service listening on port 443 with a self-signed certificate. I create a HTTP connection as below.

http = CreateHTTPConnection()
SetHTTPVerifyCertificate(http, 0)
SetHTTPTimeout(http, 3000)
SetHTTPHost(http, "mydev.domain.com", 1)

However, when making a web request I still get the following error:

Warning:Failed to send request with error 12045: The certificate authority is invalid or incorrect

VirtualNomad19 commented 7 months ago

hey, john. i have zero knowledge of such things but ran a quick search @ the forums and, while this find is in re: DBPro, this seemed pertinent:

i tried to connect securely to a website that uses self-signed certificate which is normally considered as invalid by the browser.

...while the Warning you received is not necessarily an Error?

ie, does it cause your app to crash or simply report the warning?

otherwise, Classic or Studio? OS?

JohnStabler commented 7 months ago

It doesn't crash, I just get the warning and it fails to connect.

Security-wise, connecting to a server with a self-signed certificate should fail. However the SetHTTPVerifyCertificate() function allows for the disabling of checking for the purposes of testing in a Dev environment. Currently it seems to simply do nothing.

JohnStabler commented 7 months ago

I overlooked your question about version of AGK, sorry. I tried it in both classic and studio and the result is the same. I'm using Windows 11.