Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Proper way to establish FTP data connection with SSL

843790Oct 30 2006 — edited Nov 14 2006
Hi,

I'm currently working on a small test application to simply send a file to an FTP server which uses explicit SSL. After a long struggle I was able to get connected, logged in, and the ability to do anything control related. Now, I'm faced with opening up a second socket for data to flow through and I'm not sure how to do that.

According to protocol with an explicit SSL ftp server you:

Control Socket:
1. Create standard socket and connect to host and port
2. Create SSL socket based on previous socket and send authentication SSL request
3. Handshake
4. Login

Data Socket:
???

I'm currently basing this off the Apache commons.net.ftp implementation, and I get stuck inside of _openDataConnection() in FTPClient.java.
socket = _socketFactory_.createSocket(__passiveHost, __passivePort);
Print outs reveal that __passiveHost and __passivePort are the correct numbers. Additionally, I can upload files using another program, so I know the server is not at fault. Also, I issued the "PROT P" command to protect the data channel.

When I hit the line above it gets stuck. Basically, what I'm asking is how to create a data socket off of an SSL control socket.

Thanks in advance,
-Bill
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 12 2006
Added on Oct 30 2006
1 comment
224 views