Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Secure FTP Data Channel

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Are we home yet? Wait, did we forget the tiny ad?
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic