how to disable certificate validation

Nov 18, 2015 at 5:18 PM
I am trying to do a POST on a server using the C++ Rest SDK. It works fine if the Server is set in http, however if the server is set to https, then the code fails with this error

Error exception:EinHttpSendRequest: 12175: A security error occured
I assume that this is because of the certificate validation and to bypass it I set false to set_validate_certificates. But it still gives me the same error.

This is my code.
wstring baseUrl = L"";
    http_client_config config;

    http_client httpClient(baseUrl, config);

        http_request req(methods::POST);
        req.set_body("[\"pool/test/url/server\",\"pool/test/url/instance\"]", "application/json");

        http_response httpResponse = httpClient.request(req).get();

        http::status_code st = httpResponse.status_code();

        if(httpResponse.status_code() == status_codes::OK)
            wstring output = httpResponse.extract_string().get();
            wcout << output << endl;
       catch (const std::exception &e)
         printf("Error exception:%s\n", e.what());
Please guide.
Nov 18, 2015 at 9:15 PM
Nov 19, 2015 at 3:28 PM
I am using Casablanca 2.4 with visual studio 2012
Nov 19, 2015 at 6:53 PM
Could you please try using version 2.6? We no longer support VS2012 as well, so consider using VS2015 (available for free at
Nov 23, 2015 at 1:54 AM
I just uninstalled casablanca 2.4.0 and reinstalled it again and it worked fine. Don't know what was the problem. Anyways since it is working fine now, I am moving on.
Marked as answer by roschuma on 11/23/2015 at 1:04 PM