Ignore certificates in GET request

Jul 16, 2013 at 4:27 PM
I am trying to make and HTTPS GET request in which i need to ignore the certificate warnings and also need to add the authentication token as a header in the request. i cannot find a way to do that correctly
Below is my code

// Creates an HTTP request and prints the length of the response stream.

pplx::task<void> HTTPStreamingAsync()
{
http_client client(L"https://os-swiftproxy01.servosity.com.lab:8080/v1/AUTH_ce6f184ab6ff49c0b6088ea66f50c4bb/Retesting/17/36/512/2");

http_request request(methods::GET);
request.headers().add(L"X-Auth-Token:", L"367f814f6c3d4744a877f2728a42b8b2");
//request.set_request_uri(L"Retesting/17/36/512/2");
// Make the request and asynchronously process the response.
return client.request(request).then([](http_response response)
{
// Print the status code.
std::wostringstream ss;
ss << L"Server returned returned status code " << response.status_code() << L'.' << std::endl;
std::wcout << ss.str();
});
}
int _tmain(int argc, _TCHAR* argv[])
{
HTTPStreamingAsync().wait();
return 0;
}

Any thoughts, why this code is not working?
Thanks
Coordinator
Jul 16, 2013 at 5:45 PM
Hi Akshat,

We don't have built in support right now for ignoring certificate errors. Take a look at a recent discussion about this, in there you will find a solution you can use if you are running on Windows desktop (WinHttp). Obviously there are security implications of ignoring certificate errors so please be careful. I added a feature request for this, vote for it if it is a blocker for you.

In regards to getting your code above to work, that is kind of hard to figure out just by looking at it. It would help if you had information about what happens when you run the program. Also do you need to include auth token explicitly above in your case?

Thanks,
Steve
Jul 16, 2013 at 6:32 PM
Thank you Steve,
             I am actually looking for SSL support where i can add client side certificate 
I was trying to ignore certificate as i have gone through the discussion (https://casablanca.codeplex.com/discussions/437954#editor)

Can I make a https request by adding client side certificate using Casablanca?

About the auth token - yes, I need to explicitly add it as a header with each request i make to server.

Thanks,
Akshat
Jul 16, 2013 at 7:03 PM
My bad steve,
             I needed to install the trust certificate for server. Its working fine.
Thank you