The port is used locally only (and within single WinSCP process only). I do not think you need any permission from your network team. It's not network-related.
- martin
sessionOptions.AddRawSettings("Tunnel", "1");
sessionOptions.AddRawSettings("TunnelHostName", ConfigurationManager.AppSettings["ProxyHostName"]);
sessionOptions.AddRawSettings("TunnelPortNumber", ConfigurationManager.AppSettings["ProxyPort"]);
sessionOptions.AddRawSettings("TunnelLocalPortNumber", ConfigurationManager.AppSettings["ProxyPort"]);
sessionOptions.AddRawSettings("TunnelUserName", ConfigurationManager.AppSettings["ProxyUserName"]);
sessionOptions.AddRawSettings("TunnelPublicKeyFile", ConfigurationManager.AppSettings["ProxyPrivateKeyPath"]);
sessionOptions.AddRawSettings("TunnelHostKey", ConfigurationManager.AppSettings["ProxyHostKey"]);
TunnelLocalPortNumber
, what bypasses the fix and actually cause the problem, if you use the same port for both your processes. Remove that. Or even better set a unique port for each parallel process.
2021-05-13 11:00:35.2342|Info|Exception encountered during sftp transfer: Error while tunneling the connection.
Local port 10022 forwarding to ast.carefirst.com:22 failed: Network error: Address already in use
TunnelLocalPortNumber
raw session settings:
(Exception) **Host key does not match configured key fingerprint "ssh-rsa 2048 xxxxxxxxxxxxxxxxxxxxxx="!**
SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Sftp,
HostName = ConfigurationManager.AppSettings["ClientHostName"],
UserName = ConfigurationManager.AppSettings["ClientUserName"],
Password = ConfigurationManager.AppSettings["ClientPassword"],
SshHostKeyFingerprint = ConfigurationManager.AppSettings["ClientHostKey"],
PortNumber = Convert.ToInt32(ConfigurationManager.AppSettings["ClientPort"])
};
if (tunneling)
{
sessionOptions.AddRawSettings("Tunnel", "1");
sessionOptions.AddRawSettings("TunnelHostName", ConfigurationManager.AppSettings["ProxyHostName"]);
sessionOptions.AddRawSettings("TunnelPortNumber", ConfigurationManager.AppSettings["ProxyPort"]);
sessionOptions.AddRawSettings("TunnelUserName", ConfigurationManager.AppSettings["ProxyUserName"]);
sessionOptions.AddRawSettings("TunnelPublicKeyFile", ConfigurationManager.AppSettings["ProxyPrivateKeyPath"]);
sessionOptions.AddRawSettings("TunnelHostKey", ConfigurationManager.AppSettings["ProxyHostKey"]);
}