Skip to content

docs: add SSL/TLS database connection guide and document missing env vars#2377

Merged
Micha Hobert (Isengo1989) merged 11 commits into
mainfrom
docs/database-ssl-setup
Jul 13, 2026
Merged

docs: add SSL/TLS database connection guide and document missing env vars#2377
Micha Hobert (Isengo1989) merged 11 commits into
mainfrom
docs/database-ssl-setup

Conversation

@shyim

@shyim Soner (shyim) commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

Adds a comprehensive SSL/TLS database connection guide to the database infrastructure docs and fixes documentation gaps discovered while investigating DATABASE_SSL_CA in the Shopware source code (MySQLFactory).

New SSL/TLS section in database guide:

  • Covers DATABASE_SSL_* environment variables — auto-wired by MySQLFactory, no manual config needed
  • OpenSSL certificate generation commands, AWS RDS example, verification query
  • PHP 8.2+ requirement for DATABASE_SSL_DONT_VERIFY_SERVER_CERT

Two previously undocumented env vars added:

  • DATABASE_PERSISTENT_CONNECTIONPDO::ATTR_PERSISTENT
  • DATABASE_PROTOCOL_COMPRESSIONMysql::ATTR_COMPRESS

Fixed env vars table & deployment-helper docs:

  • Updated descriptions and cross-links
  • Clarified that DATABASE_URL query parameters do not work for MySQL SSL in PHP — use DATABASE_SSL_* env vars instead

Related links

  • Source: src/Core/Framework/Adapter/Database/MySQLFactory.php — reads all DATABASE_SSL_* + DATABASE_PERSISTENT_CONNECTION + DATABASE_PROTOCOL_COMPRESSION
  • Source: src/Core/Installer/Configuration/EnvConfigWriter.php — writes DATABASE_SSL_* during install
  • Source: src/Core/Maintenance/System/Struct/DatabaseConnectionInformation.php — reads DATABASE_SSL_* for setup flow

Checklist

  • I reviewed affected links, code samples, and cross-references, including PageRef references where relevant.
  • I added or updated redirects in .gitbook.yaml if pages were moved, renamed, or deleted.
  • I updated .wordlist.txt (and sorted it) if spellcheck flags new legitimate terms.
  • Any required dependent changes in downstream modules have already been merged and published.
  • This pull request is ready for review.

Notes

No pages were moved/renamed — no redirects needed. No new non-standard terms were introduced.

…vars

- Add comprehensive SSL/TLS Connection section to database infrastructure guide
  covering DATABASE_SSL_* env vars (auto-wired by MySQLFactory), DSN query
  parameter alternative, cert generation, AWS RDS example, and verification
- Document two previously undocumented database env vars:
  DATABASE_PERSISTENT_CONNECTION and DATABASE_PROTOCOL_COMPRESSION
- Fix environment variables table descriptions to clarify that
  DATABASE_SSL_* vars are automatically applied by MySQLFactory
- Update deployment-helper docs and troubleshooting with accurate links
Copilot AI review requested due to automatic review settings July 13, 2026 08:07
@shopware-dev-docs-connector

shopware-dev-docs-connector Bot commented Jul 13, 2026

Copy link
Copy Markdown

Developer Docs healthcheck

Status: Completed with success.
Repository: shopware/docs
Commit: c2b4a6a
Preview: https://developer-documentation-6uo218msh-shopware-frontends.vercel.app
Workflow run: #4468

Comment thread guides/hosting/infrastructure/database.md Outdated

Copilot AI 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.

Pull request overview

Adds/expands Shopware hosting documentation around secure MySQL/MariaDB connections, and updates related environment-variable references to close gaps discovered around DATABASE_SSL_CA.

Changes:

  • Adds an SSL/TLS connection section to the database infrastructure guide, including env-var based setup and a DATABASE_URL query-parameter alternative.
  • Documents two previously missing database env vars (DATABASE_PERSISTENT_CONNECTION, DATABASE_PROTOCOL_COMPRESSION) in the environment variables reference.
  • Updates Deployment Helper docs to cross-link to the new SSL/TLS guidance and clarifies troubleshooting steps.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
guides/hosting/installation-updates/deployments/deployment-helper.md Adds cross-links clarifying that DATABASE_SSL_* are applied automatically by MySQLFactory
guides/hosting/installation-updates/deployments/deployment-helper-troubleshooting.md Improves TLS troubleshooting guidance and links to the SSL/TLS guide
guides/hosting/infrastructure/database.md Introduces new SSL/TLS connection documentation and advanced DB connection options
guides/hosting/configurations/shopware/environment-variables.md Fixes/expands DB-related env var table entries, including new variables and SSL/TLS notes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread guides/hosting/infrastructure/database.md Outdated
Comment thread guides/hosting/infrastructure/database.md Outdated
Comment thread guides/hosting/configurations/shopware/environment-variables.md Outdated
Comment thread guides/hosting/configurations/shopware/environment-variables.md Outdated
Comment thread guides/hosting/infrastructure/database.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
SSL query parameters (sslrootcert, sslcert, sslkey, etc.) do not work
via DATABASE_URL for MySQL in PHP. DATABASE_SSL_* env vars are the
only supported approach.

@Isengo1989 Micha Hobert (Isengo1989) 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.

Thx for the PR Soner (@shyim) 👍

Do the 2 options on DBs have any negative impacts that we should mention? For example significant longer request times (due to compression) or connection issues ?

Maybe we can add some use-cases that are very specific, I can imagine setting the persistent DB connection for a cluster can make things very bad, so its clear that this should only be set on the server that runs the worker processes.

@Isengo1989 Micha Hobert (Isengo1989) added feedback-required Undocumented Feature Feature which is not documented yet and is considered for documentation labels Jul 13, 2026
@shyim

Copy link
Copy Markdown
Member Author

not really. persistent helps with db reconnect on any connection and compression helps with throughput, i guess it makes little bit slower, but better than LAN port 100% bottle necked 😅

@Isengo1989

Micha Hobert (Isengo1989) commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

not really. persistent helps with db reconnect on any connection and compression helps with throughput, i guess it makes little bit slower, but better than LAN port 100% bottle necked 😅

If so, I am fine with it and we can merge. I read that this can be an issue if there are multiple servers and the connections are bound then (max connections).

EDIT: Just saw the other commits, thx 👍

@Isengo1989
Micha Hobert (Isengo1989) merged commit 1364229 into main Jul 13, 2026
8 of 9 checks passed
@Isengo1989
Micha Hobert (Isengo1989) deleted the docs/database-ssl-setup branch July 13, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feedback-required Undocumented Feature Feature which is not documented yet and is considered for documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants