lundi 30 mai 2016

How to debug an SSL connect error using libcurl in C++ (vs2013)

I recently went about compiling libcurl for use with Vs2013, which turned out to fairly straight forward thanks to some very useful help here on stackoverflow. After some cajoling and more online help, I've even managed to get curl to play nice inside a unique_ptr.

Standard HTTP and HTTPS transactions using curl work fine with google.com. However, a particular site using https (www.slayradio.org) unfortunately results in an 'SSL connect error'.

I have no problem connecting to the domain via https using curl in PHP. But I need it to work in C++ as well.

It seems that CURLOPT_VERBOSE is just the ticket, but turning it on seems to have no effect what so ever. I see no additional output in either the console window, nor the internal IDE output window. I messed around with the CURLOPT_STDERR option trying to specific a concrete file it should output to for a while, until I finally discovered that via the curl FAQ that passing a FILE* pointer to the libcurl DLL (which I do) causes an access violation. I know the FAQ specifically refers to CURLOPT_WRITEDATA and CURLOPT_READDATA, not CURLOPT_STDERR, but I can't imagine the same isn't the case, here.

I've discovered the CURLOPT_ERRORBUFFER setting, which a yields a slightly more helpful output:

Unknown SSL protocol error in connection to www.slayradio.org:443

But I'm still at a loss at what's causing issues.

It'd much appreciate if anyone can tell me if I shouldn't actually be seeing more output by enabling CURLOPT_VERBOSE in the console window?

I'd also be curious to hear if someone can has run into something similar before.

If I can't get Curl to be more verbose, it seems like the only option is to make use of the CURLOPT_DEBUGFUNCTION.

Aucun commentaire:

Enregistrer un commentaire