mrtazz/restclient-cpp

Can't POST inside docker container

cedricve opened this issue · 4 comments

Expected behaviour

Using your library across multiple OS, and it works great. However today I encountered an issue with your library, as it was suddenly returning response code -1 all the time (Failed to query). This only happens for me after I've packed it in a Docker container, so not sure if it will have to do with your library. Though I would like to have an idea or solution why this isn't working properly.

Actual behavior

If I do a raw curl query from the command line (inside the docker container) I get a 200.

But if I run the C++ application it returns code -1
https://github.com/mrtazz/restclient-cpp/blob/master/source/connection.cc#L384

Environment and debugging details

  • compiler and version: Docker
  • libcurl version and compile flags: curl 7.35.0
  • restclient-cpp version: 0.4.4

Update: 1 step closer, it looks when I try to GET google.com it works. Probably this has something to do with trusted certificates (Behind a SSL CDN Cloudflare). Is there a way I can disable it with this API?

So far I've gone the way of requiring the OS to be set up with the proper certs to connect instead of allowing to disable cert checking and verification (e.g. here). If this turns out to be a huge problem, I'd be open to revisit that decision.

Well this issue was two sided (resolved now), I hadn't installed most recent curl-openssl package. Also I have forked your library as it wasn't possible to disable SSL verification. Thanks for your response @mrtazz