cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Peter Sylvester <Peter.Sylvester_at_edelweb.fr>
Date: Sun, 07 Oct 2012 13:44:33 +0200

On 10/06/2012 05:47 PM, William Gallafent wrote:
> 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.

You may try to set an info callback

http://www.openssl.org/docs/ssl/SSL_CTX_set_info_callback.html

I don't remember when the SSL_CTX is freed.

>
> 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!
>

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