CurlPP SSL Issues
Hi All!
So I have been working with CurlPP lately and when trying to connect to a site with HTTPS I get:
"SSL Certificate problem: unable to get local issuer certificate"
Here is my code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
#include <curlpp/cURLpp.hpp>
#include <curlpp/Easy.hpp>
#include <curlpp/Options.hpp>
#include <iostream>
#include <ostream>
#include <fstream>
using namespace curlpp::options;
int main(int, char **)
{
std::string body;
try
{
// That's all that is needed to do cleanup of used resources (RAII style).
curlpp::Cleanup myCleanup;
std::list<std::string> header;
header.push_back("Content-Type: application/json");
curlpp::Cleanup clean;
curlpp::Easy r;
r.setOpt(new curlpp::options::Url("https://www.google.com"));
r.setOpt(new curlpp::options::HttpHeader(header));
r.setOpt(new curlpp::options::PostFields(body));
r.setOpt(new curlpp::options::PostFieldSize(body.length()));
//std::ostringstream response;
//r.setOpt(new curlpp::options::WriteStream(&response));
r.perform();
}
catch (curlpp::RuntimeError & e)
{
std::cout << e.what() << std::endl;
}
catch (curlpp::LogicError & e)
{
std::cout << e.what() << std::endl;
}
return 0;
}
|
Is there anyway I can disable SSL?
Or fix this issue?
Last edited on
Topic archived. No new replies allowed.