summaryrefslogtreecommitdiffhomepage
path: root/src/event/ngx_event_openssl_cache.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2025-01-17SSL: avoid using mismatched certificate/key cached pairs.Sergey Kandaurov1-2/+7
This can happen with certificates and certificate keys specified with variables due to partial cache update in various scenarios: - cache expiration with only one element of pair evicted - on-disk update with non-cacheable encrypted keys - non-atomic on-disk update The fix is to retry with fresh data on X509_R_KEY_VALUES_MISMATCH.
2025-01-17SSL: cache revalidation of file based dynamic certificates.Sergey Kandaurov1-2/+42
Revalidation is based on file modification time and uniq file index, and happens after the cache object validity time is expired.
2025-01-17SSL: caching certificates and certificate keys with variables.Sergey Kandaurov1-25/+215
A new directive "ssl_certificate_cache max=N [valid=time] [inactive=time]" enables caching of SSL certificate chain and secret key objects specified by "ssl_certificate" and "ssl_certificate_key" directives with variables. Co-authored-by: Aleksei Bavshin <a.bavshin@nginx.com>
2025-01-17SSL: encrypted certificate keys are exempt from object cache.Sergey Kandaurov1-15/+38
SSL object cache, as previously introduced in 1.27.2, did not take into account encrypted certificate keys that might be unexpectedly fetched from the cache regardless of the matching passphrase. To avoid this, caching of encrypted certificate keys is now disabled based on the passphrase callback invocation. A notable exception is encrypted certificate keys configured without ssl_password_file. They are loaded once resulting in the passphrase prompt on startup and reused in other contexts as applicable.
2025-01-17SSL: object cache inheritance from the old configuration cycle.Sergey Kandaurov1-8/+99
Memory based objects are always inherited, engine based objects are never inherited to adhere the volatile nature of engines, file based objects are inherited subject to modification time and file index. The previous behaviour to bypass cache from the old configuration cycle is preserved with a new directive "ssl_object_cache_inheritable off;".
2024-11-19SSL: error message default in object caching API.Sergey Kandaurov1-0/+4
This change initializes the "err" variable, used to produce a meaningful diagnostics on error path, to a good safe value.
2024-10-01SSL: caching CA certificates.Sergey Kandaurov1-0/+66
This can potentially provide a large amount of savings, because CA certificates can be quite large. Based on previous work by Mini Hawthorne.
2024-10-01SSL: caching CRLs.Sergey Kandaurov1-1/+107
Based on previous work by Mini Hawthorne.
2024-10-01SSL: caching certificate keys.Sergey Kandaurov1-0/+168
EVP_KEY objects are a reference-counted container for key material, shallow copies and OpenSSL stack management aren't needed as with certificates. Based on previous work by Mini Hawthorne.
2024-10-01SSL: caching certificates.Sergey Kandaurov1-6/+161
Certificate chains are now loaded once. The certificate cache provides each chain as a unique stack of reference counted elements. This shallow copy is required because OpenSSL stacks aren't reference counted. Based on previous work by Mini Hawthorne.
2024-10-01SSL: object caching.Sergey Kandaurov1-0/+311
Added ngx_openssl_cache_module, which indexes a type-aware object cache. It maps an id to a unique instance, and provides references to it, which are dropped when the cycle's pool is destroyed. The cache will be used in subsequent patches. Based on previous work by Mini Hawthorne.