It looks like a temporary network or server outage.
No setting can fix that.
You may want to retry the connection, if you want your code to be more robust.
I have a .NET program using WinSCPNet.dll (ver 22.214.171.12465) that is used to download files from company FTP server using SFTP protocol. The program is running in Windows Server 2016.
Sometimes, during the download process, the error "Connection to <securefile.com> refused" is logged. This does not happen often, but once in awhile and then one file will not be downloaded (or fail to download). I have noticed this behavior for 3-4 times for the past 6 months.
Is there any other settings that may need to be done?