Skip to content

fix: add SSL mode support to MySQL/MariaDB connections (#36505)#1534

Open
hidekoji wants to merge 5 commits into
masterfrom
fix/issue-36505
Open

fix: add SSL mode support to MySQL/MariaDB connections (#36505)#1534
hidekoji wants to merge 5 commits into
masterfrom
fix/issue-36505

Conversation

@hidekoji

@hidekoji hidekoji commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds full SSL mode support to MySQL/MariaDB connections in the R backend.

Changes

R/system.R

  • queryMySQL: Added sslMode = "" parameter; passes it to getDBConnection and clearDBConnection
  • executeGenericQuery: Forwards sslMode to queryMySQL (was silently dropping it)
  • getDBConnection mysql/aurora branch:
    • Added sslMode to cache key (prevents SSL-mode collision in connection pool)
    • Added switch() mapping PostgreSQL-style UI strings → RMariaDB constants:
      • "disable"SSL_MODE_DISABLED
      • "allow" / "prefer"SSL_MODE_PREFERRED
      • "require"SSL_MODE_REQUIRED
      • "verify-ca"SSL_MODE_VERIFY_CA
      • "verify-full"SSL_MODE_VERIFY_IDENTITY
    • Refactored connection creation to do.call(RMariaDB::dbConnect, ...) with conditional tz_args, ca_args, mode_args to avoid duplicating branches
  • clearDBConnection mysql/aurora branch: Added sslMode to cache key (matches getDBConnection)

How to Test

  1. Configure a MySQL/MariaDB data source with SSL mode = require (or verify-ca with a CA file)
  2. Test connection → should succeed
  3. Import data → should use the same SSL mode
  4. Verify that changing SSL mode creates a new pool connection (not the old cached one)

hidekoji added 2 commits July 1, 2026 23:26
- Add sslMode param to queryMySQL (default "")
- Wire sslMode through executeGenericQuery → queryMySQL
- Add sslMode to getDBConnection/clearDBConnection cache key for mysql/aurora
- Map PostgreSQL-style SSL mode strings to RMariaDB constants (SSL_MODE_*)
- Refactor mysql/aurora connection creation to do.call for clean conditional args
@hidekoji hidekoji self-assigned this Jul 2, 2026
Comment thread DESCRIPTION Outdated
@hidekoji
hidekoji requested a review from kei51e July 2, 2026 06:36
@hidekoji
hidekoji marked this pull request as ready for review July 2, 2026 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants