WinSCP dll SshPrivateKeyPath
Hi,
I'm trying to configure my application to use Host client PPK authentication so;
1. The host checks that it can find a matching host public key (fingerprint) on the client and
2. The client has generated a Private/Public key pair and placed it's public key onto the host.
I've supplied the path of the private client ppk file to the
Here's my code;
The issue seems to be that no notice is paid by the SFTP server of the Clients private key location, it can be anything or blank, but the client still connects via the Hosts public key fingerprint matching that of the clients.
I'm using the Bitvise SFTP server.
Have I made a mistake in the code or in the configuration of the server?
Does WinSCP perform both client and host public key comparisons?
Thanks,
Mark.
I'm trying to configure my application to use Host client PPK authentication so;
1. The host checks that it can find a matching host public key (fingerprint) on the client and
2. The client has generated a Private/Public key pair and placed it's public key onto the host.
I've supplied the path of the private client ppk file to the
SshPrivateKeyPath
attribute.
Here's my code;
lvoSessionOptions = NEW WinSCP.SessionOptions(). lvoTransferOptions = NEW WinSCP.TransferOptions(). lvoRemoteFileInfoCollection = NEW WinSCP.RemoteFileInfoCollection(). lvoTransferOptions:TransferMode = TransferMode:BINARY. ASSIGN lvoSessionOptions:HostName = SFTP_Host lvoSessionOptions:UserName = lvcUsername lvoSessionOptions:Protocol = Protocol:Sftp lvoSessionOptions:PortNumber = SFTP_Port. /* If password is provided, uses standard user/pwd auth else uses PPK */ IF lvcPassword NE "" THEN lvoSessionOptions:Password = lvcPassword. /* The path to the clients local private pk file (ppk) - from which the public key is sent to the host */ IF SFTP_ClientPrivateKeyFile NE "" THEN lvoSessionOptions:SshPrivateKeyPath = SFTP_ClientPrivateKeyFile. /* the host SFTP server's "fingerprint" */ lvoSessionOptions:SshHostKeyFingerprint = SFTP_HostPublicKey. /* If the client's local Private/Public key pair is encrypted we'll need this */ IF SFTP_ClientPrivateKeyPassword NE "" THEN lvoSessionOptions:PrivateKeyPassphrase = SFTP_ClientPrivateKeyPassword. SFTPClient = NEW WinSCP.Session(). SFTPClient:Open(lvoSessionOptions).
I'm using the Bitvise SFTP server.
Have I made a mistake in the code or in the configuration of the server?
Does WinSCP perform both client and host public key comparisons?
Thanks,
Mark.