Skip to content

Commit

Permalink
fix: MariaDB connection over SSL
Browse files Browse the repository at this point in the history
For local development, set `DOCKER_DB_SSL` to `false`.
  • Loading branch information
tomudding committed Oct 23, 2024
1 parent 573026e commit 4f53639
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ DOCKER_DB_PORT=3306
DOCKER_DB_USERNAME=gewis
DOCKER_DB_PASSWORD=gewis
DOCKER_DB_DATABASE=gewis
# The following is only used for development
DOCKER_DB_SSL=false

# These are the environment variabled for retrieving membership data (and others) from the gewisdb project
DOCKER_DB2_HOST=postgres
Expand Down
4 changes: 4 additions & 0 deletions config/autoload/doctrine.local.development.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ return [
'dbname' => getenv('DOCKER_DB_DATABASE'),
'charset' => 'utf8mb4',
'collate' => 'utf8mb4_unicode_ci',
'driverOptions' => filter_var(getenv('DOCKER_DB_SSL') ?? false, FILTER_VALIDATE_BOOLEAN) ? [
PDO::MYSQL_ATTR_SSL_CAPATH => '/etc/ssl/certs/',
PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => true,
] : [],
],
],
],
Expand Down
4 changes: 4 additions & 0 deletions config/autoload/doctrine.local.production.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ return [
'dbname' => getenv('DOCKER_DB_DATABASE'),
'charset' => 'utf8mb4',
'collate' => 'utf8mb4_unicode_ci',
'driverOptions' => [
PDO::MYSQL_ATTR_SSL_CAPATH => '/etc/ssl/certs/',
PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => true,
],
],
],
],
Expand Down

0 comments on commit 4f53639

Please sign in to comment.