How can we read HTML source from an HTTPS host?

Questions about GP commands and how to do things

Moderator: MSandro

Post Reply
MSandro
Posts: 162
Joined: Jul 26th, '17, 21:12

How can we read HTML source from an HTTPS host?

Post by MSandro » Jul 27th, '17, 19:43

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.

JohnM
Posts: 379
Joined: Sep 11th, '15, 14:42

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

Post by JohnM » Aug 3rd, '17, 23:06

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.

Post Reply