I am using the WinSCP.net library for secure FTP file transfer (at work).
I have a scheduled job that connects to a bank's server every 3 minutes.
This job will upload files, download files and delete files from the bank's FTP site.
Most of the time this works without a problem but approximately 3 or 4 times per day there will be a SessionRemoteException while attempting to open the session.
This is not restricted to the .net library and can also happen when using the WinSCP client.
I am assuming that I have the session configured correctly as this is working in our production environment most of the time.
I do not have access to the server logs but this is not isolated.
The following was recently posted to a forum by another party and it is EXACTLY the same issue:
https://superuser.com/questions/587560/winscp-sometimes-throws-error-server-refused-public-key-signature-despite-acce
As requested by the bank I do not use a Password to connect to their FTP session, could this be an issue?
I would appreciate some insight here. I have had to code some fallback procedures for when the session fails to open.
Here is the callstack for the exception. Thanks
Exception:
Exception: WinSCP.SessionRemoteException: Connection has been unexpectedly closed. Server sent command exit status 0. ---> WinSCP.SessionRemoteException: Authentication log (see session log for details):
Using username "############".
Authenticating with public key "rsa-key-########".
Server refused public-key signature despite accepting key!
Authentication failed.
--- End of inner exception stack trace ---
at WinSCP.SessionLogReader.Read(LogReadFlags flags)
at WinSCP.ElementLogReader.Read(LogReadFlags flags)
at WinSCP.CustomLogReader.TryWaitForNonEmptyElement(String localName, LogReadFlags flags)
at WinSCP.Session.Open(SessionOptions sessionOptions)[/b]