From 1af7b6358ae449679e7af38a47b6acd23910b0d5 Mon Sep 17 00:00:00 2001 From: guy levy Date: Mon, 23 Feb 2026 11:07:25 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Share=20SSL=20session=20da?= =?UTF-8?q?ta=20in=20ConnectionPool=20for=20TLS=20session=20resumption?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this, each new easy handle using the shared connection pool must perform a full TLS handshake even when reusing a pooled TCP connection. Sharing CURL_LOCK_DATA_SSL_SESSION allows libcurl to resume TLS sessions across handles. --- cpr/connection_pool.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cpr/connection_pool.cpp b/cpr/connection_pool.cpp index e645e82d8..9eca79f47 100644 --- a/cpr/connection_pool.cpp +++ b/cpr/connection_pool.cpp @@ -19,6 +19,7 @@ ConnectionPool::ConnectionPool() { }; curl_share_setopt(curl_share, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT); + curl_share_setopt(curl_share, CURLSHOPT_SHARE, CURL_LOCK_DATA_SSL_SESSION); curl_share_setopt(curl_share, CURLSHOPT_USERDATA, this->connection_mutex_.get()); curl_share_setopt(curl_share, CURLSHOPT_LOCKFUNC, lock_f); curl_share_setopt(curl_share, CURLSHOPT_UNLOCKFUNC, unlock_f);