Skip to content
Snippets Groups Projects
Unverified Commit 3846aa5d authored by Cam Saul's avatar Cam Saul Committed by GitHub
Browse files

Merge pull request #9342 from metabase/fix-jetty-ssl-config-bug

Fix jetty ssl config bug
parents 79d42093 84ba74bd
No related branches found
No related tags found
No related merge requests found
......@@ -214,18 +214,20 @@
:max-idle-time (config/config-int :mb-jetty-maxidletime)})
(config/config-str :mb-jetty-daemon) (assoc :daemon? (config/config-bool :mb-jetty-daemon))
(config/config-str :mb-jetty-ssl) (-> (assoc :ssl? true)
(merge jetty-ssl-config))))
(merge (jetty-ssl-config)))))
(defn- log-config [jetty-config]
(log/info (trs "Launching Embedded Jetty Webserver with config:")
"\n"
(with-out-str (pprint/pprint (m/filter-keys #(not (re-matches #".*password.*" (str %)))
jetty-config)))))
(defn start-jetty!
"Start the embedded Jetty web server."
[]
(when-not @jetty-instance
(let [jetty-ssl-config (jetty-ssl-config)
jetty-config (jetty-config)]
(log/info (trs "Launching Embedded Jetty Webserver with config:")
"\n"
(with-out-str (pprint/pprint (m/filter-keys #(not (re-matches #".*password.*" (str %)))
jetty-config))))
(let [jetty-config (jetty-config)]
(log-config jetty-config)
;; NOTE: we always start jetty w/ join=false so we can start the server first then do init in the background
(->> (ring-jetty/run-jetty app (assoc jetty-config :join? false))
(reset! jetty-instance)))))
......
......@@ -228,13 +228,13 @@
"inet" :type/IPAddress
nil))
(def ^:private ^:const ssl-params
(def ^:private ssl-params
"Params to include in the JDBC connection spec for an SSL connection."
{:ssl true
:sslmode "require"
:sslfactory "org.postgresql.ssl.NonValidatingFactory"}) ; HACK Why enable SSL if we disable certificate validation?
(def ^:private ^:const disable-ssl-params
(def ^:private disable-ssl-params
"Params to include in the JDBC connection spec to disable SSL."
{:sslmode "disable"})
......
......@@ -149,7 +149,7 @@
(for [{database-type :type_name
column-name :column_name
remarks :remarks} (jdbc/metadata-result
(.getColumns metadata db-name-or-nil schema table-name nil))]
(.getColumns metadata db-name-or-nil schema table-name nil))]
(merge
{:name column-name
:database-type database-type
......
(ns metabase.core-test
(:require [expectations :refer [expect]]
[metabase
[config :as config]
[core :as core]]))
;; Make sure our Jetty config functions work as expected/we don't accidentally break things (#9333)
(expect
{:keystore "10"
:max-queued 10
:port 10
:min-threads 10
:host "10"
:daemon? false
:ssl? true
:trust-password "10"
:key-password "10"
:truststore "10"
:max-threads 10
:max-idle-time 10
:ssl-port 10}
(with-redefs [config/config-str (constantly "10")]
(#'core/jetty-config)))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment