HTTPS Requests in FreeBasic

General FreeBASIC programming questions.
mvpimenta
Posts: 2
Joined: Mar 24, 2019 15:14

HTTPS Requests in FreeBasic

Postby mvpimenta » Mar 27, 2019 21:45

Hi!!!

I have a project I´m doing in the office. There is an arduino (yes!!) colector machine that sends data using https-get (=parameters in url) to a cloud server. This request needs a 'fingerprint', based on server-cert to handshake the connection and allow connectivy to site. OK, it s working done...
This servers collect data (an url API entry-point) and persist them in a cloud database.
Other API returns a compiled data list, JSon formatted, when called (... over https, too).

I need to get these data and process in my FB program. I tried to use the examples (get-https, http-page etc) I saw here, and the FB-prog works perfectly over http (:80). But, when I try the https (:443), it doesn´t connect, don´t handshake, ... I think that I´ll need to pass other data (like the fingerprint or security-cert) to handshake and accept the connection - and the data can be requested and retrieved, like http.

Well: Are there a lib, function, include or example code to work with https protocol (TLS or SSL)?
I can´t work with 'wget', 'curl' executables, (to get the file, save to disk and after that, read it via "open ... as #1'), due the Sec.Info restrictions in office..

Could you help me?
MrSwiss
Posts: 3262
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: HTTPS Requests in FreeBasic

Postby MrSwiss » Mar 27, 2019 22:54

You probably need some libraries, which deal with SSL/TLS stuff.
(cyptographically secured connections)
See: OpenSSL.org

On the use of those lib's, you'll have to consult their Documentation,
since they're not part of FBC.
St_W
Posts: 1476
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: HTTPS Requests in FreeBasic

Postby St_W » Mar 29, 2019 17:31

There's also a library-version of curl, libcurl, which provides an API that you can use directly in your application instead of running external applications. Dealing with SSL yourself can get quite complicated, so I strongly advice to use some library that handles this for you (like the one I mentioned).
TJF
Posts: 3481
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: HTTPS Requests in FreeBasic

Postby TJF » Apr 06, 2019 11:13

For https protocol (port 443) I use Gio. Find a header file at https://github.com/DTJF/gir_headers/tree/master/Gir

Regards

Return to “General”

Who is online

Users browsing this forum: MSN [Bot] and 34 guests