mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Conditionally disable strict-host-key-checking
This commit is contained in:
parent
c68ef2ff7f
commit
7265b47932
@ -15,10 +15,14 @@
|
||||
(connect [this conn-spec]
|
||||
(if (:dummy conn-spec)
|
||||
(assoc this :conn-spec conn-spec)
|
||||
(try+ (let [c (doto (SSHClient. (doto (DefaultConfig.) (.setVerifyHostKeyCertificates false)))
|
||||
(.addHostKeyVerifier (PromiscuousVerifier.))
|
||||
(.connect (:host conn-spec) (:port conn-spec))
|
||||
(auth! conn-spec))]
|
||||
(try+ (let [c (as-> (SSHClient.) client
|
||||
(do
|
||||
(if (:strict-host-key-checking conn-spec)
|
||||
(.loadKnownHosts client)
|
||||
(.addHostKeyVerifier client (PromiscuousVerifier.)))
|
||||
(.connect client (:host conn-spec) (:port conn-spec))
|
||||
(auth! client conn-spec)
|
||||
client))]
|
||||
(assoc this
|
||||
:conn-spec conn-spec
|
||||
:client c
|
||||
|
Loading…
Reference in New Issue
Block a user