cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Using Libcurl With Smart Cards / Maintaining TLS Session ID

From: Nick Zitzmann <nick_at_chronosnet.com>
Date: Mon, 27 Jan 2014 19:20:41 -0600

On Jan 27, 2014, at 5:04 PM, Joel Odom <joelodom_at_gmail.com> wrote:

> I do come with a question. Every time that I make a new request
> (using HTTPS), libcurl renegotiates the TLS connection. When client
> credentials are used, this causes the Windows certificate selection
> dialog to open every time (thanks to my changes). What is the trick
> to make libcurl save a session so that it can use the abbreviated TLS
> handshake?

Either:
1. Use the multi API, or
2. Create a share object (CURLSH), set CURLSHOPT_SHARED to CURL_LOCK_DATA_SSL_SESSION, and set the easy handle to use the share object. Don’t forget to set the lock/unlock functions for the share object.

Also, if CURLOPT_SSL_SESSIONID_CACHE is set to 0L in your easy handle, it doesn’t matter what you do; sessions will never be re-used. Make sure this is set to 1L unless you have a good reason for not wanting to re-use sessions. I think it’s 1L by default.

Nick Zitzmann
<http://www.chronosnet.com/>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-01-28