0 votes

I am making a HTTPS requests that, for some reason, on my PC (Win10) takes a long time to complete, around 20 seconds. Doing a wireshark on a curl request of the page shows that the ~20 second delay has no network traffic, and once the delay is over the request is completed as expected without any delay between the request and response. Requests on other urls (https or otherwise) don't have this delay.

However, when I use a HTTPRequest node to do the same thing in Godot, I get the same ~20 second delay and then an error response saying that the connection failed (RESULTCANTCONNECT from HTTPRequest), and wireshark is empty.

Is there some kind of built-in timeout or other possible reason as to why Godot is failing to make this (admittedly flawed) request when other programs are able to complete it after the initial delay?

Edit: Figured out the delay is due to a weird ipv6 configuration on the server in which it fails to connect. Curl hangs on this ipv6 for the 20 seconds, and when it fails it defaults back to the ipv4 connection, which works. It seems that Godot is attempting the same ipv6 connection, and responding with the "Can't connect" that the ipv6 connection sends back. New question: Is there a way to force ipv4 or let Godot ignore the failed ipv6 connection or is this now a "me and my computer" problem?

Edit 2: In case someone else has this problem, I solved it by using the IP class to resolve the hostname of the server I am connecting to into an IPv4 address with IP.resolve_hostname(host, TYPE_IPV4) and then using the HTTPRequest class as usual with the resolved address. For my server I had to disable SSL validation in the request call as the certificate was failing (which is definitely a me problem, not Godot).

in Engine by (526 points)
edited by

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.