fgenesis / minihttp

A minimal 2-file (cpp+h) TCP & HTTP client implementation. Supports GET & simple POST. Optional SSL via PolarSSL/mbedTLS. Cross-platform, uses POSIX or Win32 API. C++03 with STL.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PolarSSL -> mbedTLS

IngwiePhoenix opened this issue · comments

https://tls.mbed.org/

Basically they changed names. This might affect this library. For backwards compatibility, I'd just suggest adding MINIHTTP_USE_MBEDTLS analogous to MINIHTTP_USE_POLARSSL.

Kind regards,
Ingwie

Fixing up mbedtls compat has been on my list for quite a while, haven't gotten around to do it yet. It's currently compatible with the mbedtls-1.3 API and needs an API name fixup to work with 2.0+.

Done. mbedTLS v2.2.x support is in 'ssl' branch. Will merge into master as soon as it's confirmed to be stable. Need to do more testing for now. Please reopen if there are problems.

Do you know that moment when a couple of words can make up for an otherwise bad day?

Yeah that happened. :)

Awesome news! Thanks for letting me know! I’ll go and do testing as well and see how well it will play out with my project.

Again awesome project!

Alright! So I am preparing to have my project finally utilize miniHTTP as dependency. To do so, I wanted to undergo some basics, and try to compile it raw, without any tool, to get a feel for behaviors, and write a tiny example myself to familiarize myself with the API.

But that came to a halt fast.

Ingwie@Ingwies-MBP.Speedport_W723_V_Typ_A_1_01_012 ~/W/I/minihttp $ g++ -c minihttp.cpp 
minihttp.cpp:627:22: error: out-of-line definition of 'verifySSL' does not match any declaration in 'minihttp::TcpSocket'
SSLResult TcpSocket::verifySSL() { return SSLR_NO_SSL; }
                     ^~~~~~~~~
1 error generated.

Ah, i changed the function signature and overlooked that one. But you probably want to build with SSL support enabled anyway.

Well actually I want to build my tool in two ways.

When the user first builds it using either a script or just g++ src/*.cpp -o icetea (which works), then I want to give the tool basic functions. When the tool is then ran, it will build itself - and include stuff like minihttp with SSL enabled, mbedtls and crypto API based on mbedtls.

So I kinda need both (non-SSL and SSL) modes working :)

BTW, bug fixed, examples work. Now to code the integration! :)

Got it allll working!

https://github.com/IngwiePhoenix/IceTea/tree/master/.IceTea

minihttp.it is the build description for MiniHTTP, and the mbedtls.it one for mbedTLS. I can compile both all the way and also their examples - Travis is only complaining on Mingw builds, but these havent worked, ever, anyway. :)