Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

get Firewall configuration in JAVA

 
Mrutyunjay Hanchinal
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI
I am writing a java component that gets some files from a FTP server. If the FTP server is behind the firewall and FTP access is blocked in the forewall then the client needs to be intimated that the firewall is stopping files being downloaded.
So I think before connnecting to FTP server, if I get the info that accessing FTP server is not possible, then I can flash a message saying FTP server is behind the firewall and is not possible to connect.
So how do I go about it?
Thanks
Mrutyunjay
[ March 19, 2002: Message edited by: Mrutyunjay Hanchinal ]
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to Socket/Internet Protocols.
 
Guy Allard
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi - Two cases:
1) The wall permits no ftp whatsoever.
You should get the infamous 'connection refused' return when attempting to connect. However, you will get the same if the wall allows ftp but the ftp daemon is not started. I know of no way to tell the difference.
2) The wall allows passive ftp but not active (I hope I got those terms right and not backwards).
What will happen then, is the initial connect will work OK. But when a 'get' request is issued, the ftp daemon will switch modes and hence TCP/IP port numbers, via a negotiation with the client. It is possible to get 'connection refused' at this point! Again no real way to tell if passive/active is the real problem - maybe the daemon just crashed!

In the second case, I usually assume the wall is not configured correctly. However, it may be that a particular system would be configured to not allow 'get' requests, only 'dir' and such. Depends on the SA's objectives.
HTH (and I know it does not much), Good Luck, Guy
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic