Skip to content

Ingela/ssl/crl cache/otp 19712 - #10049

Closed
IngelaAndin wants to merge 3 commits into
erlang:masterfrom
IngelaAndin:ingela/ssl/crl-cache/OTP-19712
Closed

Ingela/ssl/crl cache/otp 19712#10049
IngelaAndin wants to merge 3 commits into
erlang:masterfrom
IngelaAndin:ingela/ssl/crl-cache/OTP-19712

Conversation

@IngelaAndin

Copy link
Copy Markdown
Contributor

Improve CRL caching. Also include a code health commit that avoids some code duplication.

@IngelaAndin
IngelaAndin force-pushed the ingela/ssl/crl-cache/OTP-19712 branch from 7f81454 to 27092e4 Compare July 16, 2025 10:27
@github-actions

github-actions Bot commented Jul 16, 2025

Copy link
Copy Markdown
Contributor

CT Test Results

    2 files     66 suites   27m 6s ⏱️
  821 tests   775 ✅  46 💤 0 ❌
4 294 runs  3 333 ✅ 961 💤 0 ❌

Results for commit c9244d1.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@IngelaAndin IngelaAndin self-assigned this Jul 16, 2025
@IngelaAndin IngelaAndin added team:PS Assigned to OTP team PS full-build-and-check Run a more thorough testing of this PR and removed full-build-and-check Run a more thorough testing of this PR labels Jul 16, 2025
@IngelaAndin
IngelaAndin force-pushed the ingela/ssl/crl-cache/OTP-19712 branch 2 times, most recently from f937d96 to 451b8ba Compare July 16, 2025 11:25
@IngelaAndin
IngelaAndin requested a review from Copilot July 16, 2025 11:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors duplicate internal_active_n logic, adds configurable CRL cache eviction in the PKIX database, and updates related modules and documentation.

  • Refactor internal_active_n to centralize its implementation in ssl_config.
  • Introduce a max_crl_cache setting and eviction logic in ssl_pkix_db.
  • Wire the new configuration through ssl_manager, ssl_crl_cache, and docs, and remove unused defines.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tls_gen_connection_1_3.erl Refactored internal_active_n to use ssl_config
ssl_pkix_db.erl Added add_crls/4 with cache size check and eviction logic
ssl_manager.erl Propagate max_crl_db_entries and updated add_crls calls
ssl_internal.hrl Removed duplicate INTERNAL_ACTIVE_N define
ssl_crl_cache.erl Enabled cache insert on HTTP success
ssl_config.erl Added DEFAULT_MAX_CRL_CACHE, get_max_crl_cache, and moved INTERNAL_ACTIVE_N
dtls_server_session_cache_sup.erl Removed unused DEFAULT_MAX_SESSION_CACHE define
dtls_packet_demux.erl Switched to ssl_config:get_internal_active_n
ssl_app.md Documented the new max_crl_cache option
Comments suppressed due to low confidence (2)

lib/ssl/doc/ssl_app.md:68

  • Documented option name does not match the configuration function 'get_max_crl_cache' and expected env var 'max_crl_cache'. Please align the doc with the code.
 - **`max_crl_cacche = pos_integer() <optional>`** - Sets the

lib/ssl/src/ssl_pkix_db.erl:381

  • There are no tests covering the new CRL cache eviction behavior. Consider adding tests to validate that entries are evicted when the cache size exceeds the limit.
add_crls([_,_,_, {Cache, _} | _]= DB, Path, CRLs, MaxSize) ->

Comment thread lib/ssl/src/ssl_config.erl Outdated
Comment thread lib/ssl/doc/ssl_app.md Outdated
Comment thread lib/ssl/src/ssl_pkix_db.erl
@IngelaAndin
IngelaAndin force-pushed the ingela/ssl/crl-cache/OTP-19712 branch from 451b8ba to 4a9a18e Compare July 16, 2025 12:55
@IngelaAndin
IngelaAndin requested review from u3s and removed request for u3s July 16, 2025 14:28
@IngelaAndin IngelaAndin added the stalled waiting for input by the Erlang/OTP team label Aug 19, 2025
@IngelaAndin
IngelaAndin force-pushed the ingela/ssl/crl-cache/OTP-19712 branch from 4a9a18e to ad6b484 Compare April 8, 2026 08:10
@IngelaAndin IngelaAndin removed the stalled waiting for input by the Erlang/OTP team label Apr 8, 2026
@IngelaAndin
IngelaAndin force-pushed the ingela/ssl/crl-cache/OTP-19712 branch from ad6b484 to 375a481 Compare April 8, 2026 08:49
@u3s
u3s requested review from dgud and u3s April 8, 2026 12:20
dgud
dgud previously approved these changes Apr 8, 2026
Comment on lines +150 to +151
case application:get_env(ssl, max_crl_cache) of
{ok, Size} when is_integer(Size) ->

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
case application:get_env(ssl, max_crl_cache) of
{ok, Size} when is_integer(Size) ->
application_int(max_crl_cache, ?DEFAULT_MAX_CRL_CACHE)

Comment thread lib/ssl/src/ssl_pkix_db.erl
@u3s

u3s commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

should target branch be maint?

Comment thread lib/ssl/src/ssl_config.erl
Comment thread lib/ssl/doc/ssl_app.md
Comment thread lib/ssl/src/ssl_config.erl
Comment thread lib/ssl/doc/ssl_app.md
Comment thread lib/ssl/src/ssl_pkix_db.erl
Comment thread lib/ssl/src/ssl_manager.erl
Comment thread lib/ssl/src/ssl_manager.erl
Comment thread lib/ssl/src/ssl_pkix_db.erl
@IngelaAndin
IngelaAndin changed the base branch from maint to master April 9, 2026 15:04
@IngelaAndin
IngelaAndin dismissed dgud’s stale review April 9, 2026 15:04

The base branch was changed.

@IngelaAndin
IngelaAndin force-pushed the ingela/ssl/crl-cache/OTP-19712 branch from 375a481 to c9244d1 Compare April 9, 2026 15:15
@IngelaAndin

Copy link
Copy Markdown
Contributor Author

should target branch be maint?

We decided not to, but it was when it was started.

@IngelaAndin IngelaAndin added the stalled waiting for input by the Erlang/OTP team label May 5, 2026
@IngelaAndin

Copy link
Copy Markdown
Contributor Author

Closes in favour of hardening commit on #11478

@IngelaAndin IngelaAndin removed the stalled waiting for input by the Erlang/OTP team label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team:PS Assigned to OTP team PS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants