Skip to content

Commit

Permalink
THREESCALE-4185: Support TLS protection for external DBs (#3846)
Browse files Browse the repository at this point in the history
* Support SSL Mysql

It works OOB, only a few env vars required

* Support SSL Postgresql

It works OOB, only a few env vars required

* Add new var `DATABASE_SSL_MODE` for Postgres

* Add `ssl_mode` for MySQL
  • Loading branch information
jlledom authored Jul 23, 2024
1 parent 95540ea commit 2c43706
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions config/examples/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ base: &default
pool: <%= ENV.fetch('RAILS_MAX_THREADS', 5) %>
variables:
timezone: 'UTC'
sslmode: <%= ENV.fetch('DATABASE_SSL_MODE', ENV.fetch('DATABASE_SSL_CA', nil) ? 'verify-full' : 'disable') %>
sslrootcert: <%= ENV['DATABASE_SSL_CA'] %>
sslcert: <%= ENV['DATABASE_SSL_CERT'] %>
sslkey: <%= ENV['DATABASE_SSL_KEY'] %>

development:
<<: *default
Expand All @@ -43,6 +47,10 @@ base: &default
encoding: utf8
pool: <%= ENV.fetch('RAILS_MAX_THREADS', 5) %>
collation: utf8_bin
ssl_mode: <%= ENV.fetch('DATABASE_SSL_MODE', ENV.fetch('DATABASE_SSL_CA', nil) ? 'verify_identity' : 'disabled') %>
sslca: <%= ENV['DATABASE_SSL_CA'] %>
sslcert: <%= ENV['DATABASE_SSL_CERT'] %>
sslkey: <%= ENV['DATABASE_SSL_KEY'] %>

development:
<<: *default
Expand Down

0 comments on commit 2c43706

Please sign in to comment.