I have an .NET console app using WinSCP assembly version 5.19.5. The app is under impersonation in order to access files on NAS so that I set ExecutableProcessUserName and ExecutableProcessPassword for the Session object.
Dim sessionOptions As New SessionOptions
With sessionOptions
.Protocol = Protocol.Sftp
.HostName = _SFTPServer
.UserName = _SFTPLoginID
.Password = _SFTPLoginPwd
.PortNumber = _SFTPPort
End With
sessionOptions.SshHostKeyFingerprint =
session.ScanFingerprint(sessionOptions, "SHA-256")
Using session As New Session
session.ExecutableProcessUserName = _ServiceAccountUsername
session.ExecutableProcessPassword =
ConvertToSecureString(_ServiceAccountPassword)
session.Open(sessionOptions)
It fails at session.Open with error:
The stub received bad data Any ideas? Thanks