"Host Key Not Verified" on FMX Android SFTP App

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
Bernie
Posts: 1
Joined: Thu 20 Aug 2020 11:26

"Host Key Not Verified" on FMX Android SFTP App

Post by Bernie » Thu 20 Aug 2020 11:53

Hi forum !

I've implemented Securebridge SFTP clients on Windows programs with Firemonkey and it works well.

But I've never been able to connect on FMX for Android platforms :

I get a "Host Key Not Verified" message even before the ScSSHClient1BeforeConnect
event triggers...

As far as I know, there's no published android demo / or android specific help doc for Android apps to find on this
website.

I saw a few other contributions on this forums about this subject, but none was helpfull enough for me.

I use these components :

ScSSHClient1 / ScFileStorage1 / ScSFTPClient1

Can somebody here please provide some help/hint ?

Thank you in anticipation !

Bernie

----------------------------------------
Delphi Rio 103.2 / Securebride 9.2.+ / Android 9

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: "Host Key Not Verified" on FMX Android SFTP App

Post by ViktorV » Sat 29 Aug 2020 11:29

The "Host key not verified" error occurs if the key received from the server and the key specified in HostKeyName do not match. You can handle the TScSSHClient.OnServerKeyValidate event. You can find the more detailed information about this event in SecureBridge help. Also you can look at the sample of this event handling in the SFTPClient demo project. The SFTPClient demo project is located at %SecureBridgeDemos%\SFTPClient. %SecureBridgeDemos% is the path where SecureBridge demo projects are installed on your computer.
The server key is used by the client to authenticate the SSH server. The key name is specified in the property TScSSHClient.HostKeyName. When the client is connecting to the SSH server, SecureBridge looks for the key under the path specified in the property TScFileStorage.Path - if it's found, the client uses the key. If the key was not found, you can use the TScSSHClient.OnServerKeyValidate event handler to obtain the server key and import it to TScStorage. If the TScSSHClient.OnServerKeyValidate event handler is not triggered, this means that the server key was found and authenticated.

Post Reply