I am trying to fetch a file over HTTPS in Io language:
url := URL with("https://api.example.com")
url fetch println
And I get this:
Error_0x7f97e1509a80:
location = "/opt/local/lib/io/addons/Socket/io/URL.io:232"
message = "Protocol 'https' unsupported"
I was trying to find something on the net, but, as everybody knows, it's not easy because of the name. I only found this thread http://tech.groups.yahoo.com/group/iolanguage/message/10898 but that's quite old.
How can I get the HTTPS support in Io?
EDIT
I've found that there is a SecureSocket addon, a wrapper over OpenSSL, in Io's source. It wasn't installed when I did sudo port io install
on my MacBook with Mountain Lion, though. I tried building it from source, but no luck. It didn't build for me on a Linux machine, either.
EDIT2
I just tried to build Io from source (git clone https://github.com/stevedekorte/io.git
) again (using the included script build.sh
) and it turned out that cmake did detect OpenSSL:
-- Found OpenSSL: /usr/lib/libssl.dylib;/usr/lib/libcrypto.dylib
But then the SecureSocket addon is not built. Its readme file: https://github.com/stevedekorte/io/tree/master/addons/SecureSocket says:
The DTLS1 bindings are not usable unless the patches in this file are applied to OpenSSL 0.9.8e. However, this patch includes a deactivation of the handshake retransmission code in d1_both.c, making it unsuitable for production environments. I take no responsibility, etc, etc. If you want to use it anyway, apply the patches(gathered from various newsgroups and my own experimentation) and uncomment the commented-out block of build.io. For what it's worth, DTLS support in OpenSSL is new as of 0.9.8 and is pretty buggy to begin with. It's a nice idea, but it doesn't seem to be production ready at all yet. These bindings are no exception.
If you can't get io to do it your best option would be calling an external tool like wget
or curl
which can and then loading the file/result locally or returning it via a pipe.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With