通过Java存储过程从TLS / SSL(FTPS)服务器连接到FTP

时间:2017-12-08 17:36:38

标签: java oracle ftps

您好, 我已经制作了将文件上传到FTP和FTPS(通过TLS / SSL)服务器的代码。它适用于本地eclipse测试,但只有FTPS上传在Oracle java存储过程上运行时才会失败。从连接点来看,它是错误的。

sys info:

  • Eclipse java版本 - " 1.8.0_151"
  • Oracle java版本 - " 1.8.0_91"
  • 公地净3.6
  • Oracle DB - 12c企业版12.2.0.1.0版 - 64位生产
import java.io.*;
import java.net.*;
import org.apache.commons.net.ftp.FTPSClient;

public class Test 
{     
    public static void setGroFilesToFtp()
    {    
        FTPSClient ftps = null;

        try {
            ftps = new FTPSClient();            
            ftps.connect("host", 21);

        } catch (SocketException e) {
            e.printStackTrace();
        } catch (IOException e) {            
            e.printStackTrace();
        }
    }    
}
java.net.SocketException: connect failed, 10022

À߸øµÈ Àμö¸¦ ÀÔ·ÂÇß½À´Ï´Ù.

at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java)
at java.net.Socket.connect(Socket.java)
at org.apache.commons.net.SocketClient._connect(SocketClient.java)
at org.apache.commons.net.SocketClient.connect(SocketClient.java)
at FtpTransfer.setGroFilesToFtp(FtpTransfer:22)

0 个答案:

没有答案