title: How to debug an SSL connect error using libcurl in C++ (vs2013)
body: <p>I recently went about compiling libcurl for use with Vs2013, which turned out to fairly straight forward thanks to some <a href="https://stackoverflow.com/questions/20171165/getting-libcurl-to-work-with-visual-studio-2013">very useful help here on stackoverflow</a>. After some cajoling and more online help, I've even managed to get curl to play nice inside a unique_ptr.</p>
  
  <p>Standard HTTP and HTTPS transactions using curl work fine with <code>google.com</code>. However, a particular site using https (www.slayradio.org) unfortunately results in an 'SSL connect error'.</p>
  
  <p>I have no problem connecting to the domain via https using curl in PHP. But I need it to work in C++ as well.</p>
  
  <p>It seems that <a href="https://curl.haxx.se/libcurl/c/CURLOPT_VERBOSE.html" rel="nofollow noreferrer">CURLOPT_VERBOSE</a> 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 <a href="https://curl.haxx.se/libcurl/c/CURLOPT_STDERR.html" rel="nofollow noreferrer">CURLOPT_STDERR option</a> trying to specific a concrete file it should output to for a while, until I finally discovered that via the <a href="https://curl.haxx.se/docs/faq.html#Does_CURLOPT_WRITEDATA_and_CURLO" rel="nofollow noreferrer">curl FAQ</a> 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, <strong>not</strong> CURLOPT_STDERR, but I can't imagine the same isn't the case, here.</p>
  
  <p>I've discovered the <a href="https://curl.haxx.se/libcurl/c/CURLOPT_ERRORBUFFER.html" rel="nofollow noreferrer">CURLOPT_ERRORBUFFER</a> setting, which a yields a slightly more helpful output:</p>
  
  <pre><code>Unknown SSL protocol error in connection to www.slayradio.org:443
  </code></pre>
  
  <p>But I'm still at a loss at what's causing issues.</p>
  
  <p>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?</p>
  
  <p>I'd also be curious to hear if someone can has run into something similar before.</p>
  
  <p>If I can't get Curl to be more verbose, it seems like the only option is to make use of the <a href="https://curl.haxx.se/libcurl/c/CURLOPT_DEBUGFUNCTION.html" rel="nofollow noreferrer">CURLOPT_DEBUGFUNCTION</a>.</p>