This is an automated email from the ASF dual-hosted git repository. dewrich pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push: new 09070ed allow ssl connection to db to be required 09070ed is described below commit 09070ed20bf80c70c35d7081fe32d4b84b6a41fe Author: Dan Kirkwood <dang...@apache.org> AuthorDate: Mon Apr 2 09:59:50 2018 -0600 allow ssl connection to db to be required --- traffic_ops/app/conf/development/database.conf | 1 + traffic_ops/app/conf/integration/database.conf | 1 + traffic_ops/app/conf/production/database.conf | 1 + traffic_ops/app/conf/test/database.conf | 1 + traffic_ops/app/lib/Schema.pm | 4 +++- 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/traffic_ops/app/conf/development/database.conf b/traffic_ops/app/conf/development/database.conf index a91d21b..c19451d 100644 --- a/traffic_ops/app/conf/development/database.conf +++ b/traffic_ops/app/conf/development/database.conf @@ -6,5 +6,6 @@ "user": "traffic_ops", "password": "twelve", "port": "5432", + "ssl": false, "type": "Pg" } diff --git a/traffic_ops/app/conf/integration/database.conf b/traffic_ops/app/conf/integration/database.conf index 89e9ef4..7946c4c 100644 --- a/traffic_ops/app/conf/integration/database.conf +++ b/traffic_ops/app/conf/integration/database.conf @@ -5,5 +5,6 @@ "user": "traffic_ops", "password": "twelve", "port": "5432", + "ssl": false, "type": "Pg" } diff --git a/traffic_ops/app/conf/production/database.conf b/traffic_ops/app/conf/production/database.conf index 19a81c1..84284ca 100644 --- a/traffic_ops/app/conf/production/database.conf +++ b/traffic_ops/app/conf/production/database.conf @@ -6,5 +6,6 @@ "user": "traffic_ops", "password": "password", "port": "5432", + "ssl": false, "type": "Pg" } diff --git a/traffic_ops/app/conf/test/database.conf b/traffic_ops/app/conf/test/database.conf index f9f4816..f41e455 100644 --- a/traffic_ops/app/conf/test/database.conf +++ b/traffic_ops/app/conf/test/database.conf @@ -5,5 +5,6 @@ "user": "traffic_ops", "password": "twelve", "port": "5432", + "ssl": false, "type": "Pg" } diff --git a/traffic_ops/app/lib/Schema.pm b/traffic_ops/app/lib/Schema.pm index 7907530..9c57fb4 100644 --- a/traffic_ops/app/lib/Schema.pm +++ b/traffic_ops/app/lib/Schema.pm @@ -48,7 +48,9 @@ sub get_dsn { our $hostname = $db_info->{hostname}; our $port = $db_info->{port}; our $type = $db_info->{type}; - our $dsn = "DBI:$type:database=$dbname;host=$hostname;port=$port"; + # add `ssl: true` to database.conf to require ssl + our $reqssl = $db_info->{ssl} ? 'require' : 'disable'; + our $dsn = "DBI:$type:database=$dbname;host=$hostname;port=$port;sslmode=$reqssl"; } sub get_dbinfo { -- To stop receiving notification emails like this one, please contact dewr...@apache.org.