Skip to content

MDEV-28233: rsync SST script silently runs unencrypted if stunnel is not installed#5264

Open
hemantdangi-gc wants to merge 1 commit into
MariaDB:10.6from
mariadb-corporation:10.6-MDEV-28233
Open

MDEV-28233: rsync SST script silently runs unencrypted if stunnel is not installed#5264
hemantdangi-gc wants to merge 1 commit into
MariaDB:10.6from
mariadb-corporation:10.6-MDEV-28233

Conversation

@hemantdangi-gc

@hemantdangi-gc hemantdangi-gc commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

MDEV-28233: rsync SST script silently runs unencrypted if stunnel is not installed
Issue:
When ssl-mode required encryption but the means to perform it was missing,
the SST scripts silently fell back to a cleartext transfer:

  • wsrep_sst_rsync: ran over plain TCP when the 'stunnel' binary was absent.
  • wsrep_sst_mariabackup: socat used a cleartext socket when ssl-mode was set
    but no usable cert/key was found (encrypt stayed 0).

Solution:
Abort the SST instead of falling back to an unencrypted transfer when
ssl-mode is not DISABLED but encryption cannot be set up:

  • wsrep_sst_rsync: derive the implicit ssl-mode from the SSL config even
    when stunnel is absent, then abort with ENOENT if ssl-mode is active
    and the stunnel binary is not found.

  • wsrep_sst_mariabackup: after reading the SSL configuration, abort with
    EINVAL if ssl-mode is not DISABLED but encrypt resolved to 0 (no usable
    cert/key).

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request ensures that the rsync SST script (wsrep_sst_rsync.sh) aborts with an error instead of silently falling back to an unencrypted transfer when SSL encryption is requested but the stunnel binary is missing. It also adds a new Galera MTR test to verify this behavior. The review feedback correctly points out that the test should not include 0 in the allowed exit codes when expecting mysqld to fail to start, as a successful startup (exit code 0) would represent a test failure.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread mysql-test/suite/galera/t/galera_sst_rsync_missing_stunnel.test Outdated

@janlindstrom janlindstrom left a comment

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.

Please add changes for mariabackup also and use only one test case using .combinations file.

@janlindstrom janlindstrom left a comment

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.

Looks good to me.

…not installed

Issue:
When ssl-mode required encryption but the means to perform it was missing,
the SST scripts silently fell back to a cleartext transfer:
- wsrep_sst_rsync: ran over plain TCP when the 'stunnel' binary was absent.
- wsrep_sst_mariabackup: socat used a cleartext socket when ssl-mode was set
  but no usable cert/key was found (encrypt stayed 0).

Solution:
Abort the SST instead of falling back to an unencrypted transfer when
ssl-mode is not DISABLED but encryption cannot be set up:
- wsrep_sst_rsync: derive the implicit ssl-mode from the SSL config even
  when stunnel is absent, then abort with ENOENT if ssl-mode is active
  and the stunnel binary is not found.

- wsrep_sst_mariabackup: after reading the SSL configuration, abort with
  EINVAL if ssl-mode is not DISABLED but encrypt resolved to 0 (no usable
  cert/key).

@janlindstrom janlindstrom left a comment

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.

Looks good.

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

Development

Successfully merging this pull request may close these issues.

3 participants