summaryrefslogtreecommitdiffhomepage
path: root/src/event/ngx_event_openssl_cache.c (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2025-06-21Use NULL instead of 0 for null pointer constant.HEADmasterAndrew Clayton1-1/+1
There were a few random places where 0 was being used as a null pointer constant. We have a NULL macro for this very purpose, use it. There is also some interest in actually deprecating the use of 0 as a null pointer constant in C. This was found with -Wzero-as-null-pointer-constant which was enabled for C in GCC 15 (not enabled with Wall or Wextra... yet). Link: <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117059>
2025-05-26SSL: disabled UI console prompts from worker processes.Aleksei Bavshin1-1/+20
Certain providers may attempt to reload the key on the first use after a fork. Such attempt would require re-prompting the pin, and this time we are not able to pass the password callback. While it is addressable with configuration for a specific provider, it would be prudent to ensure that no such prompts could block worker processes by setting the default UI method. UI_null() first appeared in 1.1.1 along with the OSSL_STORE, so it is safe to assume the same set of guards.
2025-05-26SSL: support loading keys via OSSL_STORE.Aleksei Bavshin1-5/+81
A new "store:..." prefix for the "ssl_certificate_key" directive allows loading keys via the OSSL_STORE API. The change is required to support hardware backed keys in OpenSSL 3.x using the new "provider(7ossl)" modules, such as "pkcs11-provider". While the engine API is present in 3.x, some operating systems (notably, RHEL10) have already disabled it in their builds of OpenSSL. Related: https://trac.nginx.org/nginx/ticket/2449
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.