Easiest way to grab a webpage in C? (via https)

Almost the same question as asked here: What's the easiest way to grab a webpage in C?

however the conditions have changed and I need to connect via https, this is a little more complicated, who has any snippets?

I am on the qnx platform, creating and compiling additional libraries and rolling it out on our product is very, very difficult, given the limitations. Things like libcurl are not possible.

Results: It turns out I had to install libcurl on QNX after all. This involved installing perl and openSSL to build libcurl, but once that was built it was good to go. It was the least desirable option, but it was worth it.

+1


a source to share


3 answers


libcurl should be able to handle whatever you need.



+7


a source


If you cannot use the library, then I think you are either being tricked into saying "invoke a shell or other environment that already has this capability." I'm not very familiar with QNX or the environments where it usually runs, not enough to be able to resolve this feature myself anyway.

By the way, before you skip this: libcurl is known to be based on QNX, so try this before reading any further.



Otherwise, taking the question literally, I think you need to implement the relevant parts of the HTTP protocol yourself. Since you now need secure access, you are in a world of resentment. You just don't want to implement this type of code yourself, it's a lot of work, a lot of wheels to reinvent.

At the very least, I would recommend taking a close look to make sure any of the things you need to do this are already implemented. This page assumes that OpenSSH is available for the QNX platform, which is encouraging.

+1


a source


I was away when you posted this follow-up question.

I have now posted a sample program that supports SSL at http://pastebin.com/f1cd08b33

This needs to be linked to OpenSSL ( -lssl

), but not needed libcurl

at all.

0


a source







All Articles