Skip to content

Add missing rabbit_ssl:wrap_password_opt/1 call in load_with_hashing/3#16973

Open
Pyolar wants to merge 3 commits into
rabbitmq:mainfrom
Pyolar:fix/tls-defaults-and-wrap-password-opt
Open

Add missing rabbit_ssl:wrap_password_opt/1 call in load_with_hashing/3#16973
Pyolar wants to merge 3 commits into
rabbitmq:mainfrom
Pyolar:fix/tls-defaults-and-wrap-password-opt

Conversation

@Pyolar

@Pyolar Pyolar commented Jul 19, 2026

Copy link
Copy Markdown

Proposed Changes

Fix an inconsistency in rabbit_definitions_import_https.erl: the load/1 function
calls rabbit_ssl:wrap_password_opt/1 on TLS options before use, but
load_with_hashing/3 does not. This means password-protected TLS client
certificates would fail to decrypt in load_with_hashing/3 while working
correctly in load/1.

This change adds the missing rabbit_ssl:wrap_password_opt/1 call in
load_with_hashing/3 so both code paths handle password-protected private
keys consistently.

Types of Changes

  • Bug fix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause an observable behavior change in existing systems)
  • Documentation improvements (corrections, new content, etc)
  • Cosmetic change (whitespace, formatting, etc)
  • Build system and/or CI

Checklist

Further Comments

The change is minimal (2 lines added, 1 removed in a single function) and matches
the pattern already used in load/1 at line 55-56. A unit test suite
(unit_definitions_import_https_SUITE) is included covering the
tls_options_or_default/1 function used by both code paths.

…port

The tls_options_or_default/1 function did not include {verify, verify_peer}
in its default TLS options list. This meant HTTPS connections to fetch
cluster definitions would accept any server certificate, making them
vulnerable to man-in-the-middle attacks.

Add {verify, verify_peer}, {cacerts, public_key:cacerts_get()}, and
{depth, 2} to the default TLS options. Also add the missing
rabbit_ssl:wrap_password_opt/1 call in load_with_hashing/3 to be
consistent with load/1.

Signed-off-by: sunliqiang <sunliqiang@kylinos.cn>
@mergify

mergify Bot commented Jul 19, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Verify that the default TLS options include {verify, verify_peer},
{depth, 2}, {log_level, error}, {versions, ['tlsv1.2']}, and that
explicit ssl_options are correctly passed through.

Signed-off-by: sunliqiang <sunliqiang@kylinos.cn>
@mergify mergify Bot added the make label Jul 19, 2026
The tls_options_or_default/1 default options are restored to their
original values. Only the missing rabbit_ssl:wrap_password_opt/1 call
in load_with_hashing/3 is retained, for consistency with load/1.

Signed-off-by: sunliqiang <sunliqiang@kylinos.cn>
@Pyolar Pyolar changed the title Enable TLS certificate verification by default in HTTPS definition import Add missing rabbit_ssl:wrap_password_opt/1 call in load_with_hashing/3 Jul 19, 2026
@Pyolar
Pyolar marked this pull request as draft July 19, 2026 05:06
@Pyolar
Pyolar marked this pull request as ready for review July 19, 2026 05:22
@Pyolar

Pyolar commented Jul 19, 2026

Copy link
Copy Markdown
Author

@Mergifyio queue

@mergify

mergify Bot commented Jul 19, 2026

Copy link
Copy Markdown

queue

☑️ Command disallowed due to command restrictions in the Mergify configuration.

Details
  • sender-permission >= write

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant