cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH] SSL_CTX caching - revisited

From: Shmulik Regev <shmulbox_at_gmail.com>
Date: Thu, 16 Aug 2007 15:23:33 +0300

I'm re-submitting a patch to libcurl that reuses SSL_CTX objects across
multi objects (see http://curl.haxx.se/mail/lib-2007-03/0061.html). I have
been using the code for a couple of months now without any sign of problems.
The implementation (which is now simpler than the original patch) assumes
that the following openssl parameters are the same for all the multi handles
that are binded to a share instance that implements SSL_CTX reuse: cert,
cipher_list, CAfile, CApath . The SSL_CTX objects (one per SSL_METHOD) are
managed by the share instance and are freed only when the share is.

Usage:
    curl_share_setopt(share,CURLSHOPT_SHARE,CURL_LOCK_DATA_SSL_CTX);

Also attached is a test that utilizes multiple multi handles with a single
share handle that reuses the SSL_CTX object.

Cheers,
Shmul

Received on 2007-08-16