HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.17k stars 656 forks source link

[Python] __main__._HxException: Https is only supported with -lib hxssl #5578

Closed MatthijsKamstra closed 6 years ago

MatthijsKamstra commented 8 years ago

I tried to access https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY

and get this error:

...
    raise _HxException("Https is only supported with -lib hxssl")
__main__._HxException: Https is only supported with -lib hxssl
Error: Command failed with error 1

added -lib hxssl but that failed because there is no mention of python.Lib

And when I visit https://github.com/tong/hxssl:

Please note hxssl is depreciated from Haxe 3.3.0 on as it has been merged into Haxe core. This library is no longer maintained, but it will still work for previous versions of Haxe.

MatthijsKamstra commented 8 years ago

fiddle around with the problem.. could remove the HxException with

#elseif python
sock = new sys.net.Socket();

(https://github.com/HaxeFoundation/haxe/blob/development/std/haxe/Http.hx#L441)

But that only provided een Eof error.

Source can be found here: https://github.com/MatthijsKamstra/haxepython/blob/master/06nasa/code/src/Main.hx

Code works with Neko

nadako commented 8 years ago

This is going to require implementation of sys.ssl.Socket for Python (right now it's only implemented for Neko and C++). It should be possible using standard Python library https://docs.python.org/3.2/library/ssl.html

frabbit commented 6 years ago

Basic support for https requests is done in 659dfa63bd917b9ddfaa25ad278916fa6a2fc275.