mirror of
https://github.com/curl/curl.git
synced 2026-07-28 13:53:07 +03:00
lib: TLS session ticket caching reworked
Described in detail in internal doc TLS-SESSIONS.md Main points: - use a new `ssl_peer_key` for cache lookups by connection filters - recognize differences between TLSv1.3 and other tickets * TLSv1.3 tickets are single-use, cache can hold several of them for a peer * TLSv1.2 are reused, keep only a single one per peer - differentiate between ticket BLOB to store (that could be persisted) and object instances - use put/take/return pattern for cache access - remember TLS version, ALPN protocol, time received and lifetime of ticket - auto-expire tickets after their lifetime Closes #15774
This commit is contained in:
parent
e5e2e09a75
commit
fa0ccd9f1f
36 changed files with 1784 additions and 780 deletions
11
lib/share.h
11
lib/share.h
|
|
@ -31,6 +31,8 @@
|
|||
#include "urldata.h"
|
||||
#include "conncache.h"
|
||||
|
||||
struct Curl_ssl_scache;
|
||||
|
||||
#define CURL_GOOD_SHARE 0x7e117a1e
|
||||
#define GOOD_SHARE_HANDLE(x) ((x) && (x)->magic == CURL_GOOD_SHARE)
|
||||
|
||||
|
|
@ -58,9 +60,7 @@ struct Curl_share {
|
|||
struct hsts *hsts;
|
||||
#endif
|
||||
#ifdef USE_SSL
|
||||
struct Curl_ssl_session *sslsession;
|
||||
size_t max_ssl_sessions;
|
||||
long sessionage;
|
||||
struct Curl_ssl_scache *ssl_scache;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
@ -68,4 +68,9 @@ CURLSHcode Curl_share_lock(struct Curl_easy *, curl_lock_data,
|
|||
curl_lock_access);
|
||||
CURLSHcode Curl_share_unlock(struct Curl_easy *, curl_lock_data);
|
||||
|
||||
/* convenience macro to check if this handle is using a shared SSL spool */
|
||||
#define CURL_SHARE_ssl_scache(data) (data->share && \
|
||||
(data->share->specifier & \
|
||||
(1<<CURL_LOCK_DATA_SSL_SESSION)))
|
||||
|
||||
#endif /* HEADER_CURL_SHARE_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue