Problem using SSHClient and SSHChannel
Posted: Mon 26 Aug 2013 13:59
Hello,
I have an application which communicates with an equipment using TClientSocket class on 3 different ports 5000, 5001, 5002.
The application can be instantiated several times to connect to other similar equipments still using the same ports but a different IP address.
I want to secure communication between this application and the equipments with SSH while keeping existing behavior with equipment not having SSH activated.
SSH is already implemented on some equipments, there is no server centralizing access to the equipments.
I am using C++ Builder 2007 IDE and SecureBridge v5.5.1
Initialization of SSHClient and SSHChannel are done as follows:
_pSSHClient->HostName = aIpAddress;
_pSSHClient->HostKeyName = _keyFileName;
_pSSHClient->Port = 22;
_pSSHClient->User = login;
_pSSHClient->Authentication = atPassword;
_pSSHChannel->SourcePort = 22;
_pSSHChannel->DestPort = 5000;
_pSSHChannel->DestHost = _pSSHClient->HostName;
I have the OnServerKeyValidate() event called but I get the exception "Host key not verified" due to an empty NewServerKey parameter.
Am I following the right steps to implement the way I want the application to behave ?
Any idea why I have this exception knowing that using Tera Term client I get the server fingerprint witout error and am able to connect to the equipment ?
Thanks
I have an application which communicates with an equipment using TClientSocket class on 3 different ports 5000, 5001, 5002.
The application can be instantiated several times to connect to other similar equipments still using the same ports but a different IP address.
I want to secure communication between this application and the equipments with SSH while keeping existing behavior with equipment not having SSH activated.
SSH is already implemented on some equipments, there is no server centralizing access to the equipments.
I am using C++ Builder 2007 IDE and SecureBridge v5.5.1
Initialization of SSHClient and SSHChannel are done as follows:
_pSSHClient->HostName = aIpAddress;
_pSSHClient->HostKeyName = _keyFileName;
_pSSHClient->Port = 22;
_pSSHClient->User = login;
_pSSHClient->Authentication = atPassword;
_pSSHChannel->SourcePort = 22;
_pSSHChannel->DestPort = 5000;
_pSSHChannel->DestHost = _pSSHClient->HostName;
I have the OnServerKeyValidate() event called but I get the exception "Host key not verified" due to an empty NewServerKey parameter.
Am I following the right steps to implement the way I want the application to behave ?
Any idea why I have this exception knowing that using Tera Term client I get the server fingerprint witout error and am able to connect to the equipment ?
Thanks