Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[eval] SSL support #7619

Open
markknol opened this issue Nov 15, 2018 · 11 comments

Comments

@markknol
Copy link
Member

commented Nov 15, 2018

I want to download a file from https link within a macro, but I get an error:

Https is only supported with -lib hxssl

I installed haxelib install hxssl but that has errors:

C:\HaxeToolkit\libs\hxssl/3,0,0-alpha/sys/ssl/Socket.hx:335: characters 10-13 : Type not found : Lib
C:\HaxeToolkit\libs\hxssl/3,0,0-alpha/sys/ssl/Socket.hx:338: characters 34-37 : Type not found : Lib

I'm using Haxe 4.0.0-preview-5.

cc @tong : I've added you to this issue since you are original author of the hxssl library, maybe you can help?

@Simn

This comment has been minimized.

Copy link
Member

commented Nov 15, 2018

I don't know if we want to have this in the compiler...

@markknol

This comment has been minimized.

Copy link
Member Author

commented Nov 15, 2018

I would be fine to still add-lib hxssl or some alternative library, but it somehow has to work :)

@tong

This comment has been minimized.

Copy link
Contributor

commented Nov 15, 2018

hxssl are neko/cpp bindings not available in macro context.
You might use something like curl with sys.io.Process here.

@ncannasse

This comment has been minimized.

Copy link
Member

commented Nov 15, 2018

We definitely want to be able to make https requests in haxelib run and other eval-based tools

@tong

This comment has been minimized.

Copy link
Contributor

commented Nov 15, 2018

We definitely want to be able to make https requests in haxelib run and other eval-based tools

The ancient 'ssl written in haxe' issue :)

@kevinresol

This comment has been minimized.

Copy link
Contributor

commented Nov 15, 2018

@markknol judging from the error message I guess you are using tink_http. If that's the case you can try the CurlClient. For fetch(), use this option: {client: Curl}.

But yes, cross platform support of the sys.ssl.Socket class would be nice.

@ncannasse

This comment has been minimized.

Copy link
Member

commented Nov 16, 2018

We won't implement a full SSL client in Haxe, but we can use the same wrapper we use for neko/hashlink/etc. and port it to OCaml API instead.

@ncannasse

This comment has been minimized.

Copy link
Member

commented Nov 16, 2018

Or instead use an available ocaml-ssl package on opam https://opam.ocaml.org/packages/ssl/

@Simn

This comment has been minimized.

Copy link
Member

commented Nov 16, 2018

Linking openssl is still quite heavy...

@andyli

This comment has been minimized.

Copy link
Member

commented Nov 16, 2018

There is a pure OCaml TLS implementation: https://opam.ocaml.org/packages/tls/
Not sure how easy to use, but I'm sure it's quite some work for me to package it for the Linux distros...

@Simn Simn added this to the Backlog milestone Dec 12, 2018

@ncannasse ncannasse modified the milestones: Backlog, Release 4.1 Feb 13, 2019

@ncannasse

This comment has been minimized.

Copy link
Member

commented Sep 10, 2019

Could we have a more meaningful error message in the meanwhile?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.