Differences

This shows you the differences between the selected revisions of the page.

2019-07-26 2019-08-05
restoring previous exit codes (martin) sessionOptions_sshhostkeyfingerprint_is_not_set (martin)
Line 466: Line 466:
If you cannot access the inner exception easily, inspect WinSCP session log and debug log file (''[[library_session#sessionlogpath|Session.SessionLogPath]]'', ''[[library_session#debuglogpath|Session.DebugLogPath]]''). If those file are not even created, the root cause can be loading of ''WinSCPnet.dll'' assembly. See [[message_net_system_cannot_find_file_specified|Could not load file or assembly 'file:///...\WinSCPnet.dll' or one of its dependencies. The system cannot find the file specified.]]. If you cannot access the inner exception easily, inspect WinSCP session log and debug log file (''[[library_session#sessionlogpath|Session.SessionLogPath]]'', ''[[library_session#debuglogpath|Session.DebugLogPath]]''). If those file are not even created, the root cause can be loading of ''WinSCPnet.dll'' assembly. See [[message_net_system_cannot_find_file_specified|Could not load file or assembly 'file:///...\WinSCPnet.dll' or one of its dependencies. The system cannot find the file specified.]].
 +
 +===== [[sessionOptions_sshhostkeyfingerprint_is_not_set]] SessionOptions.Protocol is Protocol.Sftp or Protocol.Scp, but SessionOptions.SshHostKeyFingerprint is not set =====
 +
 +When connecting using SFTP or SCP protocols, which run over [[ssh|SSH]], [[ssh_verifying_the_host_key|server's host key must be verified]]. In [[library|WinSCP .NET assembly]], you do by setting [[library_sessionoptions#sshhostkeyfingerprint|''SessionOptions.SshHostKeyFingerprint'' property]] to the value of fingerprint of the expected host key.
 +
 +A C# example:
 +
 +<code csharp>
 +SessionOptions sessionOptions = new SessionOptions
 +{
 +    Protocol = Protocol.Sftp,
 +    HostName = "example.com",
 +    UserName = "username",
 +    Password = "password",
 +    SshHostKeyFingerprint = "ssh-rsa 2048 2EPqmpSRaRtUIqwvm15rzavssrhHxJ3avJWh9mBaz8M=",
 +};
 +</code>
 +
 +To learn how to find the value of the fingerprint see [[faq_hostkey|Where do I get SSH host key fingerprint to authorize the server?]]
 +
 +Though as with the most of session settings, if you have the site set up in WinSCP GUI, you can have it [[ui_generateurl#code|generate a code template]] for you, including the ''SessionOptions.SshHostKeyFingerprint''.
===== [[path_slash_ambiguous]] Selecting files using a path ending with slash is ambiguous. Remove the slash to select the folder. Append * mask to select all files in the folder. ===== ===== [[path_slash_ambiguous]] Selecting files using a path ending with slash is ambiguous. Remove the slash to select the folder. Append * mask to select all files in the folder. =====

Last modified: by martin – Currently locked by: 107.175.26.148