HttpClient SSL A connection with the server could not be established

Sep 29, 2015 at 8:27 PM
Edited Sep 29, 2015 at 8:27 PM
Hi!

I'm using httpclient to talk to an API through SSL. I'm using http_client_config to add a client certificate through the native handle lambda.

When I make a request, I get an exception
"WinHttpSendRequest: 12029: A connection with the server could not be established\r\n"
Any clue of what is going on? How can I get more information?

The server has a trusted certificate.

Thanks in advance for your help!
Sep 29, 2015 at 11:45 PM
Actually, I tried a more basic example and I'm getting the same error:
        http_client client(U("http://www.bing.com"));
        uri_builder builder(U("/search"));
        builder.append_query(U("q"), U("Casablanca CodePlex"));

        auto task = client.request(methods::GET, builder.to_string()).then([](http_response response)
        {

        }).wait();
May this be due to preprocessor directives? These are my current ones:
NDEBUG;_WIN64;_AMD64_;AMD64;CONDITION_HANDLING=1;NT_UP=1;NT_INST=0;WIN32=100;_NT1X_=100;WINNT=1;_WIN32_WINNT=0x0601;WINVER=0x0601;_WIN32_IE=0x0603;WIN32_LEAN_AND_MEAN=1;DEVL=1;DBG=1;_DLL=1;_MT=1;NOMINMAX;INLINE_HRESULT_FROM_WIN32;CRYPT_OID_INFO_HAS_EXTRA_FIELDS;UNICODE;_UNICODE;_BIND_TO_CURRENT_ATL_VERSION=1;_BIND_TO_CURRENT_CRT_VERSION=1;_HAS_CPP0X=1;CRYPT_VERIFY_MESSAGE_PARA_HAS_EXTRA_FIELDS;_WINSOCK_DEPRECATED_NO_WARNINGS;NO_WCHAR_T=1;
Any help of why I get this error in such a simple example will be greatly appreciated. Thanks!
Sep 30, 2015 at 9:04 PM
Update, even in a brand new project with the code above and without any preprocessor directives I get the same error. What is going on here? How can I get more info about the exception? Do you have any ideas of what could be happening? Thanks!
Sep 30, 2015 at 9:30 PM
Edited Sep 30, 2015 at 9:53 PM
[deleted]
Oct 6, 2015 at 6:16 AM
hey carlosscastro

That seems weird. Sending a HTTP::GET request is a very basic scenario, that we test thoroughly. The above sample code works in my setup.
Are you able to use any other client to send the request?
One way to go about troubleshooting this is to use a debugging proxy tool like Fiddler.
Have you checked your firewall settings?

Thanks
Kavya.
Apr 26 at 2:48 PM
probably you need admin rights in order to connect the client