Looking for a High Level C++ SSL Library [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I checked out quite a few SSL librarys tonight. OpenSSL looks good but lacks documentation, as most of them do. I thought I hit the jackpot when I found NetSieben's SSL C++ Library (http://www.netsieben.com/products/ssh/index.phtml) but after hours, I am unable to get it to compile. It says it needs Botan's lib, but absolutely no information how to link it to Botan or anything.
So I am looking for a fairly easy to use SSL library. I am just using it for a client application to connect to an already existing server.

To give a more thorough answer: There are a number of SSL libraries that are better documented than OpenSSL, which is notoriously bad.
If you look at the grand picture, the real alternatives as an SSL library are Botan, PolarSSL, Mozilla NSS, Wolf and GnuTLS.
All except Botan are not C++ specific so they do not have nice C++ objects and resource management.
My personal preference for SSL library is PolarSSL, because of the readability of the code, in-header API documentation and just general good experiences with it. It is used in some large FOSS projects and they have some kind of government accreditation.
I'm not a real fan of the wrappers like Boost.Asio as they still lack the proper documentation for the more in depth things. Boost.Asio itself is quiet ok and the examples are pretty decent though. If you only need a simple client, this might be the way to go.
Mozilla NSS is one of the older ones, but it does not support the newer TLS 1.1 and TLS 1.2 standards, which they actually should.
Both Botan and CyaSSL are good alternatives too. Botan documentation is thorough on some parts and perhaps a bit lacking on other parts, but some large open source projects include Botan and have good experiences with it.
In general, you can do a lot better than OpenSSL with any of these.
Hope this helps!

Boost.Asio provides SSL capabilities by wrappering OpenSSL. The examples are fairly straightforward, for client-code it looks something like this
ssl::context ctx(my_io_service, ssl::context::sslv23);
ctx.set_verify_mode(ssl::context::verify_peer);
ctx.load_verify_file("ca.pem");
ssl::stream<ip::tcp::socket> ssl_sock(my_io_service, ctx);
ip::tcp::socket::lowest_layer_type& sock = ssl_sock.lowest_layer();
sock.connect(my_endpoint);
sock.handshake();
sock.write(...);
note there are asynchronous methods async_connect and async_handshake and async_write too.

For a simple well-documented SSL library, you could look at https://polarssl.org.
PolarSSL has full API documentation and example clients on its source page.
Disclaimer: I'm the lead-maintainer for PolarSSL

Mozilla NSS is a relatively better documented set of libraries.

You might like CyaSSL, which is another SSL implementation. You can download it at http://www.yassl.com.

Related

C/C++ HTTP Client Library for Embedded Projects [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
The community reviewed whether to reopen this question 9 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
So I have trawled through pages and pages of search results on StackOverflow and Google and I have come across very few C/C++ HTTP client libraries suitable for a resource-constrained, embedded environment (e.g. an ARM). I have however come across quite a few that are suitable for desktop-class applications.
Essentially, I am after a simple, easy-to-use and convenient API to make HTTP GET, POST and HEAD calls (with support for authentication, download resume and payload compression). It would be ideal if it had a small footprint (i.e. no or minimal external dependencies) and is open-source (with a permissive license).
Here's a list of what I've come across so far and why they are not suitable -
curl - too heavyweight
poco - too heavyweight
neon - GPL
qlibc - relies on POSIX libraries
cpp-netlib - relies on Boost libraries
serf - relies on the Apache Portable Runtime library
urdl - relies on Boost libraries
HTTP Client C API - promising but requires a C++ wrapper
Are there any libraries out there that I am unaware of or am I better off rolling my own?
Have you taken a look at the HTTPClient on mbed? Looks like there are lots of forks of an original from a few years ago that wasn't maintained. I haven't used this...
http://mbed.org/users/WiredHome/code/HTTPClient/
I can just describe what I used for those tasks.
curl - if you are lazy, you can just download in built binary and have nothing to do more, it has very simple headers and a lot of examples. You will need 3-4 already built libraries and header. With no external dependencies. So, I would count it as too low-level, but not heavyweight at all.
boost.asio - very interesting paradigm of realization, quite easy and clean. But I would say it is low-level too. Harder then curl. And needs to use boost, that is external dependency you want to avoid, I guess.
poco - best solution for http server. It's high level, after you joined it to your application, you just need to implement few virtual functions, having all other work (and thread management) done. Poco gives a lot of stuff for application management, thread/process management and it is very simple and easy, I would even say it has java-like interface. Yes, there is external dependency to poco, but I would look at this as a chance to learn perfect library. Still, for http clients it is really heavy.
That is all my C++ experience with HTTP. Counting you need just client and don't need dependencies, I would offer you to look at libcurl library. It's cross-platform, easy, no dependencies and low-level enough to get all you need with network. And if you will have time - look at Poco, really, I believe you will fell in love with this library as I did.
Hope that will be helpful.
I found another one, which just needs to be packed into a lib.
didn't test it, but may be worth a look:
https://github.com/reagent/http.git

Cross platform Networking API [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I was wondering if there was an API to do networking that would work on Windows, Mac and Linux. I would like to make a card game that 2 people can play through a TCP connection.
There are a few options for this, some easier to use than others:
APR (Apache Portable Runtime) - Very popular. Quite easy to use. Includes lots of additional features handy for network programming (threads, mutexes, etc.)
ACE - Popular among the embedded space. Personally, I found it quite a complicated API, and not very straightforward to use.
Boost - If you have a decent level of sophistication with C++ (templates, metaprogramming, etc.), then Boost libraries are generally very good. I'm not sure how popular the Boost asynchronous networking libraries are in the real world.
QT - Popular as a UI toolkit, but has a great set of threading, event management, networking libraries. IMO, this is by far the easiest to use.
It's important to stay away from using the berkeley sockets library, as the implementations across operating systems vary wildly, and you'll lose a fair bit of time to tuning them as you port your software across OSs.
My personal preference: APR.
most of the berkeley sockets api works everywhere.
You can use ACE or Boost.Asio:
About ACE:
Increased portability -- ACE components make it easy to write concurrent networked applications on one OS platform and quickly port them to many other OS platforms. Moreover, because ACE is open source, free software, you never have to worry about getting locked into a particular operating system platform or compiler configuration.
About boost:
Boost.Asio is a cross-platform C++ library for network and low-level I/O programming that provides developers with a consistent asynchronous model using a modern C++ approach.
The NRL has a really great library of networking methods that supports a large variety of platforms. They have excellent support from the actual developers on their mailing lists as well.
Protolib
For this simple application you can use the standard "Berkeley socket" functions that are mostly portable. You can also use Boost's abstractions.
If you needed security functions like SSL/TLS (which you don't need for a simple game I guess), there are open source libraries like OpenSSL, GNU TLS, Mozilla NSS.
I've got a feeling the Apache Portable Runtime might help with what you're looking for. Apache HTTPD used this library internally to abstract its platform-specific code so that the server code focuses on the logic and calls the methods in the APR and these translate to underlying operating system functions.
Of course, it might have more tools in it than you strictly need...
Synapse is good multiplatform network library. Open source and very easy to use.
http://www.ararat.cz/synapse/doku.php/download
SDL Net is a very simple abstraction layer on top of sockets, that's very easy to use. See http://www.libsdl.org/projects/SDL_net.

Recommendations for an open-source project to help an experienced developer practice C++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I'm looking for recommendations for open-source projects written in C++ that will help me "get my chops back". A little background:
I've been working heavily in Java for the last three years, doing a lot of back-end development and system design, but with a fair amount of work in the presentation layer stuff, too.
The last C++ projects I worked on were a Visual C++ 6 project (designed to interact with Visual Basic) for mobile devices and several projects using the GNU toolchain circa gcc versions 2.x to 3.2
I'm looking to get back up to speed on the language and learn some of the popular frameworks, specifically the basics of boost (although boost seems fairly sprawling to me, similar to the kitchen-sink feel of Spring in the java space) and test driven development in C++.
What I'm looking for:
Specific recommendations for small to mid-size open source projects to poke through and perhaps contribute to as I level my C++ skills back up. The problem domain isn't important, except that I would like to work on something in a new area to broaden my experience.
Edit:
A few people have commented that it's difficult to provide a recommendation without some indication of the problem domain I'd like to work in. So, I've decided that I'm most interested in graphics applications or games, two areas which I haven't worked in before.
If you like visual stuff, openFrameworks is a C++ Framework for doing Processing-type applications. http://www.openframeworks.cc/ I'm not sure how viable it still is, but it looked pretty cool.
It's hard to suggest something like this, you really don't have any itches you want to scratch??
I would personally be working on Unladen Swallow if I wasn't absurdly busy starting my own personal venture. Dynamic language optimisation looks pretty cool to me.
You could also look at Wt
Why not Boost itself? It's a very active project, it's right at the core of what C++ is about, and it could need some help.
You mentioned test driven development. The Boost Unit Test Framework, for example, is powerful, but IMHO suffers from extremly bad documentation. That'd be a place to start, would teach you everything there is to know about that particular part of Boost, and I am sure you could find your way into one of the Boost modules from there.
I think you're going to have to be more specific. As a quick check, I did an apt-cache showpkg libstdc++6 on my Debian squeeze system, to find all the packages that depend on the C++ library — and found 4,537 of them. Obvious examples include:
most of KDE
Firefox, Thunderbird, etc.
apt-get itself
It'd really help if you specified what field you're interested in.
You can find many projects on GitHub. If you find a nice project, you can fork it (it's like creating a local copy you can work on) and start coding. Once you have done something nice, you can make a "Pull request" to ask the guy you made your fork from to merge your work.
I like being able to commit without having to ask for an access and be able to make smalls contributions to many projects without having to contact anybody, simply with a couple of clicks.
You can also check Gitorious and Bitbucket, both site work a bit like Github.

Good free FTP Client Library (for Windows C++ commercial apps)? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm looking for a good open source Windows FTP client library with a public domain or BSD-type license. Something that I have access to the source code and I can use it from C++ for Windows applications in a commercial app.
We have used Wininet for years and it's buggy and horrible. The last straw is the IE8 beta 2 contains a new bug in InternetGetLastResponseInfo(). I can no longer justify using Wininet when our users can install the latest version of IE and break our app.
I have looked at libcurl but it is way too heavy for our needs. The only thing I need is FTP support. I could spend a day stripping out all the code in libcurl I don't need, but I'd rather just start with a nice simple FTP client library, if possible.
I looked at ftplib (http://nbpfaus.net/~pfau/ftplib/) but it's GPL and I need this for a closed-source commercial app.
I've written FTP client code before, it's not that hard (unfortunately it was 15 years ago and I don't have the source code anymore). There must be a nice simple free client library that does nothing but FTP and has a license that can be used in closed-source commercial apps.
(If you are curious, the bug is that if you attempt to FtpFindFirstFile() with an FTP site where you can't make a passive-mode connection, InternetGetLastResponseInfo() doesn't return the full response. This is just one of many bugs I've found over the years. Another is that Wininet's FTP support ignores all timeout values. That particular bug has existed for years.)
You need Ultimate TCP/IP which is now free!
http://www.codeproject.com/KB/MFC/UltimateTCPIP.aspx
You get FTP. HTTP, SMTP, POP and more.
You won't regret it.
I have used libCurl to very good effect. The only disadvantage is that, to my knowledge, there is no support for parsing directory information that comes back from FTP servers (apparently, there is no standard directory format).
Checkout filezilla server for windows.
Are you looking for a command-line interface or an API? You may be able to adapt the feature-rich wget to your needs. Otherwise, take a look at http://www.sourceforge.net for lots of options.
This is the best FTP library I know: Kira's FTP Library, you can download it at: http://kirarelease.altervista.org/Home/index.html
Pass with the mouse above the box, you will understand why I like it so much: The code is the simplest I've found til now :)

portable zip library for C/C++ (not an application) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I want to be able to zip files from my non-gui C/C++ application, on several versions of Windows, Linux/Unix, and MacOS.
The user will compile and run using this app using Eclipse + makefile or VisualStudio. I don't want the user to have to install something separately, or have my makefile install executables.
Prefer open-source. I'm already looking at "Zip 3.0"...
Take a look at Libarchive. I spent a lot of time seeking for a cross-platform and LGPL licensed library with convenient interface. This the best of all I've seen. Very easy and powerful tool. Originally designed for Unix-like systems but there's also the Windows version.
I've had great results with miniz: https://code.google.com/p/miniz/
For a simple compression of strings in c++, I also really like Timo Bingmann's solution.
I'd recommend ZipLib https://bitbucket.org/wbenny/ziplib/wiki/Home
Personal reasons why I love this project:
built around c++11 stl streams (ex. decompresses into stl streams!)
lightweight (no dependencies other than zlib)
can be used on both windows & liunx
It took me a long time to find this project - hope this helps someone.
We've used zlib a couple times here. It's a fairly standard library that has implementations in most main languages.
How about this:
http://zziplib.sourceforge.net/
http://www.info-zip.org/UnZip.html
HTH
Others have mentioned zlib, which is nice and fairly easy.
The 7-Zip (LZMA) SDK is more complex but also has very nice compression rates.
Edit: Although still in development, with the release process and history over time, I would be hesitant to recommend this now.
ZLIB - the most portable library in the world. open source, very proven and reliable. The gold standard.
why use anything else?