Page 1 of 1

How can we read HTML source from an HTTPS host?

Posted: Jul 27th, '17, 19:43
by MSandro
Hi, I played around a bit with the block (http host [] >) and I tried to read from an HTTPS host. I know this block was made for HTTP but is it currently posible to read HTTPS with GP? This would be very nice. Maybe GP can use HTTPS certificates from the system or the standard browser to get access to encrypted web pages.

Re: How can we read HTML source from an HTTPS host?

Posted: Aug 3rd, '17, 23:06
by JohnM
Funny, I ran into exactly this issue when Dan Garcia was demoing calling a server at the Scratch conference. He was showing the server being called from Snap, but I was meanwhile trying to make GP call his servers. In one case the server was a simple http:// server, and calling it from GP worked fine. However, in the other case it was an https:// server. I tried to call the API via http:// and got an HTTP redirect to the https:// address which GP did not handle.

My conclusion is that GP needs to call an underlying HTTP library that can handle certificates, redirects, and all the other low-level details. I like to implement things in GP itself when possible, but since certificates are part of a deeper security mechanism I think its better (and safer) to let the underlying OS deal with them.

So, this is on my list of features to add. If anyone reading this has recommendations for an open-source, portable, cross-platform http/s library written in C, I'd be interested in suggestions. There seem be be a number of libraries to choose from but I haven't sorted through them yet.