Skip to main content
Participating Frequently
May 12, 2025
Answered

Problem with cfftp connecting to SFTP site - connection times out

  • May 12, 2025
  • 3 replies
  • 655 views

Hi,

Trying to connect to SFTP site, was getting connection timed out at first.  I looked around for others with the issue found some leads.  Finally with try/catch when dumping cfftp after the end of try cfftp is undefinded.  I have stop on error turned on and secure.  I have tried with Developer Editions of 2023 & and a recent install of Developer 2025.  I did add the extensions to the timeout at both the page and tag level.

 

This is the detail message from 2023 for the catch - Verify your connection attributes: username, password, server, fingerprint, port, key, connection, proxyServer, and secure (as applicable). Error: java.net.ConnectException: Connection timed out: connect.

 

I would like to be able to do this within CF without resorting to WinScp.

 

I have connected to other standard FTP sites successfully.

 

Any help would be appreciated.

Mike

 

 

    Correct answer BKBK

    Since you cannot even connect, I can think of three possible causes. You should look into each of them:

    1. Remote server down
    The remote server 192.149.21.102 might be offline or experiencing network issues.

    2. Port 22 (sFTP) is blocked
    A firewall on the remote server might be blocking port 22.

     

    3. Your IP is blocked or not whitelisted
    The remote server might be configured to only allow sFTP from specific IPs, and your machine or ColdFusion server isn’t on the list.

     

    3 replies

    Participating Frequently
    May 20, 2025

    Thanks everyone for the input and suggestions.

     

    The issue did get resolved, goes back to trying the most obvious things first.  The server does double duty as a remote access server.  I missed that it's traffic has a NAT rule and goes out a different IP, so I had not given the partner the correct IP to whitelist.  Once I found another SFTP site to test against, it became clear what the answer what to do.  Once I gave them the IP everything worked as expected.

     

    Again, thanks to everyone that noticed the original post and took the time to offer suggestions and advice.

    BKBK
    Community Expert
    Community Expert
    May 20, 2025

    Hi @Michael33885037mhf4 , thanks for the update.

    BKBK
    Community Expert
    Community Expert
    May 13, 2025

    Perhaps the site is down or the port number has changed. So, first of all, test to see whether an FTP connection can be made to the site.

    For example, on Windows, I can use Powershell to test whether it is possible to connect to the free, public FTP site, test.rebex.net on port 21. The steps are:

    1.  Open Powershell 'As Administrator';
    2.  Enter the following command after the prompt: Test-NetConnection -ComputerName <host> -Port <portNumber>,
           replacing <host> and <portnumber> with the actual values, for example,
           Test-NetConnection -ComputerName test.rebex.net -Port 21
            or
          
      Test-NetConnection -ComputerName 194.108.117.16 -Port 21
    3.  Press Enter, and you should get a result similar to the following: 


    Community Manager
    May 13, 2025

    @Michael33885037mhf4 In case you are still facing the issue after the earlier suggested step, please reach out to us at cfsup@adobe.com

     

    Thanks

    Abhishek

    Charlie Arehart
    Community Expert
    Community Expert
    May 12, 2025

    Michael, you've not clarified when it worked before and when it stopped working. Also, the timeout may be misleading. 

     

    Since you're experiencing this with cf2023, note that the Oct 2023 update (https://helpx.adobe.com/coldfusion/kb/coldfusion-2021-update-17.html) indicates in "bugs fixed" (not so obviously) how--if the server you're talking to uses md5 and rsa--cf no longer supports that by default (for security reasons). If that may be your situation, you need to tell cf to allow for that, by adding these to the java args for cf (in the admin or jvm.config file):

    -Dcoldfusion.sftp.enable-ssh-rsa=TRUE -Dcoldfusion.sftp.fingerprint=md5

    And it's also now indicated for cf2025 as well in the cfml reference for the cfftp. Even if it does not SEEM like that's your situation, it's easy enough to try. 

     

    Let us know if those get you going (after a restart of cf). If not, there may be more to consider before giving up. 

    /Charlie (troubleshooter, carehart. org)
    Participating Frequently
    May 12, 2025

    Charlie,

     

    Thanks for the info.

     

    This is a new application, so never worked for SFTP in this case.

    First it looks like I may have more going on.  Neither WinScp or Filezilla are able to make connections to the site, but I can use Filezilla from my PC.  I don't think it is firewall tried turning that off, no luck.  Might be something DNS related for some odd reason.

    Once I get those working I will update the jvm config and if I am still having problems I will let you know.

     

    Thanks again.

    Mike