Curl with SSL Support? Other SSL Network Options?


I have a few questions, wasn’t quite sure how to phrase the subject line. Generally, I’m looking for the most efficient and easy networking solution to use along with OF. My experience comes from web development, and I typically use cURL and PHP to make requests to API’s etc. That would be my most immediate need, communicating with API’s like Twitter, Twilio, Flickr, etc. Most of these API’s are strictly based on SSL requests now, and that’s where my issues are lying.

I’ve looked at ofxCurl, it pretty much does what I would be looking for, without support for the SSL protocol. I also attempted to start my own addon, compiling my own version of libcurl that does include SSL support, but am getting stuck.

I also looked at ofxTwitterStream, which was working a little while ago, but I think when the Twitter Streaming API changed to being SSL only, things got sticky. I know this addon use POCO for it’s network requests, something I don’t have any experience with.

I guess I’m wondering if there is a standard protocol for making network requests (POCO vs cURL vs anything else)? Does anyone have any suggestions of things that have worked well for them?

I did get cURL to work inside an OF application, but the SSL support was the issue. I really like using cURL for web applications and would be interested in getting it setup as a nice networking solution in my OF apps. It’s very easy and flexible when compiled correctly.

Any help or suggestions would be very much appreciated. Thanks a lot everyone for anything you can provide.


Hi m i’m updating ofxTwitterstream to use curl with ssl. I’m almost done with all the basic features but have to update the examples. I hope you can wait a couple of days, or contact me offlist then I’ll mail you the new version.

Have tried updating OF with ssl support but that seems to be a lot more work then using curl. Poco support on networking in general and implementation is not as good as curl. I think curl is really the way to go when you want to do standard protocol networking.

Best roxlu

Thanks for the reply. I’ve got nothing time sensitive so I have no problems waiting until you’ve made some headroom with ofxTwitterStream.

I remember the version I had that did work a while ago was very much geared toward Twitter. I spent some good time last night trying to work on a cURL + ssl addon that would allow for any general networking requests to be made simple. Do you have any plans to update ofxCurl after you have worked on ofxTwitterStream?

Lastly, have you any experience with cURLpp? It is the only C++ wrapper for cURL i have heard of, but haven’t had much luck compiling that for use in OF either.

Thanks a lot for your hard work, let me know if you have any thoughts on any of this.

I am just now getting cURL with SSL support working in a new OF class :slight_smile:

I am going to play around with it a little more, than I may start work on a new cURL addon. @Roxlu, do you have plans to further develop ofxCurl? I don’t want to step on any feet if you have been making strides with that.

I’ll keep you updated on what I’ve found. Lots of little picky things to finally have SSL support.

Hi mst12228, normally you would fork ofxCurl, make your changes and send me a pull request. Though if you want to follow a totally different approach in implementing curl I would say go for it and create a new addon. I think it’s also kind of the way that people create duplicate addons wrapping the same library.


any progress around this?
I’d be interested :slight_smile:

Julien, I’ve added the curl addon here:

Hi. I’ve attached what little I had started in January, I never really got into finishing it. One of the main things I got stuck on was converting the data (string) that gets returned by libcurl into whatever type of string OF uses. I think it was because libcurl is not C++ but just C (i’m not clear about these differences yet).

I can’t confirm that it will work for everyone because I first had to compile curl and openSSL libraries for my machine. I’m working on a MacBook Pro, and libraries are compiled in 32 bit. I have Xcode 4.2 and OSX 10.6.8.

But, I had gotten curl compiled with openSSL and wrote this little application to demonstrate receiving responses from secure requests. There would definitely be a lot of work to get this into something legit, but if anyone wants to check it out, it’s potentially on the right track.

File is here:
Edit: See post below for GitHub URL.

Also - I really haven’t worked on writing any addons myself, just using openFrameworks with addons that others have written. If you DO look at what I’ve attached here, I would love to hear about what I did totally wrong or what was right… you know, LEARNING.

Lastly, there is a file in the data folder that turned out to be ESSENTIAL in this all working. It is the CACert.pem file that is required by curl when using with SSL requests.

Thanks for any help or feedback you can provide.

I an effort to become more familiar with the GitHub process, I’ve also moved what I started to here:

I am try to get back into working on it a little bit, but would still appreciate someone taking a look and letting me know if I’m on the right track.

hey @mst1228 , your link don’t works. did you still having this?

Hey @moebiussurfing ! Apologies for the late response.

I must have changed my GitHub username at some point, the repo for that project is now here:

Major word of caution: I haven’t thought about it for several years and don’t personally have intentions of updating it. @bakercp basically did all of it, he might be a better user to ask questions if you run into anything.

Best of luck!

1 Like