title: libcurl: Is there any way to get certificates of FTPS without logging in?
body: <p>libcurl can get certificate info by using <a href="http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html#CURLINFOCERTINFO" rel="nofollow"><code>CURLINFO_CERTINFO</code></a>, but that info must come after <code>curl_easy_perform</code>, which means you need to log in to the FTP server first without verifying the certificates.</p>
  
  <p>FTP software like FileZilla get the certificates and then ask the user to trust them or not, just before sending username and password.</p>
  
  <p>The following OpenSSL command can also get the certificates with no username or password:</p>
  
  <p><code>$ openssl s_client -showcerts -connect ftp.godaddy.com:21 -starttls ftp</code></p>
  
  <p>I also tried using <code>CURLOPT_VERBOSE</code> to monitor the FTP commands.  After <code>AUTH TLS</code> command is OK, it'll stop immediately and try to get the cert info.  But that didn't work.</p>