• Post Reply Bookmark Topic Watch Topic
  • New Topic

Secure FTP Data Channel

 
Joe Ammons
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi long time reader first time poster.

Anyway I'm writing a secure ftp client using SSLSockets, my test ftp server is BSDFTPD-SSL.

I have gotten the control channel working so I can handle commands like CWD, PWD but I'm stuck on the data channel.

My connection goes like this:

connect with plain socket
send USER command over plain socket
send AUTH command over plain socket
create SSLSocket control_sct
start handshake with control_sct
send PASS command over control_sct
send PBSZ command over control_sct
send PROT P command over control_sct
Then do normal FTP stuff for example List...
send TYPE I command over control_sct
send PASV command over control_sct
create a new SSLSocket data_sct
...don't know how to set up data_sct
get LIST output using data_sct
close data_sct

Whats happening is when ever I send a LIST command one of two things happen:
* The data socket freezes.
* The contents of the directory are recieved but the confirmation message is encrypted.

Either way my control socket dies.

I assume that whenever I send the LIST command, the control channel's encryption suite, and private key, etc. are used to encrypt over the data channel my question is can I create a new SSLSocket with the control socket's settings that were setup during the handshake.

I'd appreciate any help if anyone has any suggestions.
 
Joe Ammons
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Geez nevermind I was using the wrong socket, my plain connect socket, to read the control socket's Transfer Complete reply. Everything is cool.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!