cURL / Mailing Lists / curl-library / Single Mail

curl-library

How to obtain detailed SSL diagnostics after a transfer which used OpenSSL?

From: William Gallafent <william_at_gallaf.net>
Date: Sat, 6 Oct 2012 16:47:42 +0100

Hi all,

I'm interested in determining which compression method has been used
for an HTTPS transfer performed using libcurl.

I'm aware of the CURLOPT_SSL_CTX_FUNCTION option, which allows me to
set a callback which is passed an SSL_CTX* just before a transfer is
initiated.

First question: is this SSL_CTX* still valid /after/ the call to
curl_easy_perform()? If so it might be possible to get the SSL* I need
out of it … although I'm not sure how to do this, I couldn't find a
way to get an SSL* (or a list of SSL*s) from an SSL_CTX.

Second question: how can I get to the SSL* which was actually used for
this transfer, in order that I can interrogate it?

In particular, I want to be able to determine which compression method
was used using the following calls:

const COMP_METHOD *SSL_get_current_compression(SSL *s);
const COMP_METHOD *SSL_get_current_expansion(SSL *s);
const char *SSL_COMP_get_name(const COMP_METHOD *comp);

So, in short, how do I obtain the SSL* corresponding to a particular
transfer, after that transfer has taken place (or at least, after the
compression type has already been negotiated?), so that I can read out
the compression method that was used?

Or, if this isn't possible, I guess I need to alter my local copy of
libcurl to give me this information at the appropriate moment! Any
pointers regarding where in libcurl's codebase to do this would be
useful!

Any help welcome, thanks!

-- 
Bill Gallafent.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-10-07