Skip to content
Snippets Groups Projects
Commit f9987894 authored by Allen Gilliland's avatar Allen Gilliland
Browse files

Merge pull request #235 from metabase/ag-support-ssl

add in a quick fix to support ssl connections on postgres db connections...
parents 16cef588 dcc07a64
Branches
Tags
No related merge requests found
......@@ -3,6 +3,7 @@
[clojure.string :as s]
[korma.db]
[swiss.arrows :refer :all]
[metabase.config :as config]
[metabase.driver :refer [connection connection-details]]))
(defmethod connection-details :postgres [database]
......@@ -15,8 +16,10 @@
{:keys [host dbname port host]} details]
(-> details
(assoc :host host ; e.g. "localhost"
:make-pool? false
:db-type :postgres ; HACK hardcoded to postgres for time being until API has a way to choose DB type !
:port (Integer/parseInt port)) ; convert :port to an Integer
(cond-> (config/config-bool :mb-postgres-ssl) (assoc :ssl true :sslfactory "org.postgresql.ssl.NonValidatingFactory"))
(rename-keys {:dbname :db}))))
(defmethod connection :postgres [database]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment