+3 votes

What I have is something like:

httpClient.connect("abc.appspot.com", 443, true)

Later I call httpClient.poll() then I check httpClient.get_status() to see how the connection is going. However, the program ends abruptly and silently without any debug info/error/etc. Well, Mac OS has a crash log, but that's some language I don't understand. With breakpoints I found it ends at httpClient.poll() function at a point, but I have not enough knowledge to trace into the Godot's C++ source.

I searched a bit about it and I thought this was due to the OpenSSL integration issue with 2.0.2 and the master I compiled at that time. But when I tried with 2.0.3, which was said to have the openssl re-enabled in the official build, it still crashes silently.

I started to doubt that it was me who didn't use it the right way, so I asked here. Any help/sample code/leads would be much appreciated!

in Engine by (112 points)

2 Answers

0 votes
Best answer

@vinod pointed out part of the answer, which is the crt file configuration needed. The crt file should be a PEM file containing public keys to verify the web site you are visiting. More details are in http://docs.godotengine.org/en/latest/tutorials/ssl_certificates.html (this is not the way at least in 2.0.{2,3}, in which you need to manually specify the ssl category and then add a certificates variable).

From what I found, that's not enough. openssl itself does not seem to be properly enabled in 2.0.{2,3} releases. I debugged the engine (@commit 926495d) and found the sudden termination happens at StreamPeerSSL::create(), which in turn calls the function StreamPeerSSL::_create points to, which again at runtime is a NULL pointer. I found the whole ssl facilities are not initialized at all. And that was due to that in SConstruct file, openssl option has been commented out. Re-enabling the openssl option by remove the commenting, the SSL works just fine in HTTPClient.

by (112 points)
edited by
+1 vote

I didn't checked in the current version. But once I made an openclipart plugin. I was getting some similar errors because openclipart website is SSL enabled. Godot require a client side certificate to validate the SSL connection. So I copied one from my computer and chose that as ssl certificate path in Godot project settings. After that, it did work.

Check this:

I am not sure if it works. Try it.

by (750 points)

Thanks @vinod, I'll go and check this out. However I have been unable to configure the ssl -- I was following http://docs.godotengine.org/en/latest/tutorials/ssl_certificates.html, which seems not applicable to the current version. I raised an issue with godot-docs to check how I can achieve cert configuration.

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 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 webmaster@godotengine.org with your username.