Connecting to host takes 30 seconds using SFTP
Version: WinSCP.exe = 5.5.6.0, WinSCPnet.dll = 5.5.6.0
I've being trying to get to the bottom of the issue of why WinScp takes 30 seconds to connect to the host before uploading a file. This isn't a new issue and has always happened, so not sure if its an issue with the environment I'm running in or if we are missing a WinSCP setting.
Previously FTP uploads were being carried out using the GUI, (which also exhibited this behaviour), but I've coding a C# implementation and experience the same issue no matter which raw settings I change. I've attached the log and debug files, (with some masking), but the pertinent part from the file is:
. 2015-02-20 09:10:50.740 --------------------------------------------------------------------------
. 2015-02-20 09:10:50.741 Looking up host "secureftp.testserver.com"
. 2015-02-20 09:10:50.751 Connecting to 123.456.789.012 port 8080
. 2015-02-20 09:11:21.475 Server version: SSH-2.0-OpenSSH_4.0
. 2015-02-20 09:11:21.475 Using SSH protocol version 2
. 2015-02-20 09:11:21.475 We claim version: SSH-2.0-WinSCP_release_5.5.6
. 2015-02-20 09:11:21.759 Doing Diffie-Hellman group exchange
. 2015-02-20 09:11:21.955 Doing Diffie-Hellman key exchange with hash SHA-1
. 2015-02-20 09:11:22.260 Verifying host key rsa2 123456MASKED
. 2015-02-20 09:11:22.260 Host key matches configured key
So the FTP does work its just the initial connection appears to be waiting for 30 seconds then continues. I'm setting up the session Options as described in the documentation, (obviously you can't see the variables below but you get the idea):
Protocol = protocol,
PortNumber = roct.ConnectionPort,
HostName = roct.ConnectionHost,
UserName = roct.ConnectionUsername,
Password = roct.ConnectionPassword,
FtpMode = WinSCP.FtpMode.Passive,
Timeout = TimeSpan.FromSeconds(200),
SshHostKeyFingerprint = roct.ConnectionSshHostKeyFingerprint
and Raw settings:
sessionOptions.AddRawSettings("ProxyMethod", rocpt.ProxyMethodWinScp.ToString());
sessionOptions.AddRawSettings("ProxyHost", rocpt.ProxyHost);
sessionOptions.AddRawSettings("ProxyPort", rocpt.ProxyPort.ToString());
sessionOptions.AddRawSettings("SendBuf", "262144");
sessionOptions.AddRawSettings("PingIntervalSecs", "5");
I tried changing the pingIntervalSecs to 5 as I can see from the logs that it was defaulting to 30 and was hoping this may resolve the issue, but this made no difference.
Is there another raw setting to change, or is the issue at the other server, or an issue with the Proxy or a firewall which you can deduce from the attached log/debug?
Thanks for your help,
Steven
I've being trying to get to the bottom of the issue of why WinScp takes 30 seconds to connect to the host before uploading a file. This isn't a new issue and has always happened, so not sure if its an issue with the environment I'm running in or if we are missing a WinSCP setting.
Previously FTP uploads were being carried out using the GUI, (which also exhibited this behaviour), but I've coding a C# implementation and experience the same issue no matter which raw settings I change. I've attached the log and debug files, (with some masking), but the pertinent part from the file is:
. 2015-02-20 09:10:50.740 --------------------------------------------------------------------------
. 2015-02-20 09:10:50.741 Looking up host "secureftp.testserver.com"
. 2015-02-20 09:10:50.751 Connecting to 123.456.789.012 port 8080
. 2015-02-20 09:11:21.475 Server version: SSH-2.0-OpenSSH_4.0
. 2015-02-20 09:11:21.475 Using SSH protocol version 2
. 2015-02-20 09:11:21.475 We claim version: SSH-2.0-WinSCP_release_5.5.6
. 2015-02-20 09:11:21.759 Doing Diffie-Hellman group exchange
. 2015-02-20 09:11:21.955 Doing Diffie-Hellman key exchange with hash SHA-1
. 2015-02-20 09:11:22.260 Verifying host key rsa2 123456MASKED
. 2015-02-20 09:11:22.260 Host key matches configured key
So the FTP does work its just the initial connection appears to be waiting for 30 seconds then continues. I'm setting up the session Options as described in the documentation, (obviously you can't see the variables below but you get the idea):
Protocol = protocol,
PortNumber = roct.ConnectionPort,
HostName = roct.ConnectionHost,
UserName = roct.ConnectionUsername,
Password = roct.ConnectionPassword,
FtpMode = WinSCP.FtpMode.Passive,
Timeout = TimeSpan.FromSeconds(200),
SshHostKeyFingerprint = roct.ConnectionSshHostKeyFingerprint
and Raw settings:
sessionOptions.AddRawSettings("ProxyMethod", rocpt.ProxyMethodWinScp.ToString());
sessionOptions.AddRawSettings("ProxyHost", rocpt.ProxyHost);
sessionOptions.AddRawSettings("ProxyPort", rocpt.ProxyPort.ToString());
sessionOptions.AddRawSettings("SendBuf", "262144");
sessionOptions.AddRawSettings("PingIntervalSecs", "5");
I tried changing the pingIntervalSecs to 5 as I can see from the logs that it was defaulting to 30 and was hoping this may resolve the issue, but this made no difference.
Is there another raw setting to change, or is the issue at the other server, or an issue with the Proxy or a firewall which you can deduce from the attached log/debug?
Thanks for your help,
Steven