Commit 8c3f8737 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Catch load known hosts IO exception

parent 9e16c724
Pipeline #7327 failed with stages
in 1 minute and 25 seconds
......@@ -20,6 +20,7 @@ package org.memobase
import java.io.Closeable
import java.io.File
import java.io.IOException
import java.net.ConnectException
import java.net.UnknownHostException
import java.util.Properties
......@@ -39,7 +40,11 @@ class SftpClient(sftpSettings: Properties) : Closeable {
private val instance: SFTPClient
init {
try {
// ssh.loadKnownHosts()
try {
ssh.loadKnownHosts()
} catch (ex: IOException) {
log.warn(ex.message)
}
ssh.addHostKeyVerifier(sftpSettings.getProperty("fingerprint"))
ssh.connect(sftpSettings.getProperty("host"))
ssh.authPassword(sftpSettings.getProperty("user"), sftpSettings.getProperty("password"))
......
sftp:
host: sftp-test-env
host: swissbib/sftp-test-env
port: 22
user: user
password: password
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment