使用ftpsClient连接ssl加密的ftp报如下错误
相关依赖如下:
<dependencies>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.6</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
</dependencies>
测试代码如下
public class vsftpConnection {
public static void main(String[] args){
FTPSClient ftpsClient = new FTPSClient();
try {
ftpsClient.connect("xxx",xxx);
ftpsClient.login("admin", "xxx");
ftpsClient.list();
ftpsClient.disconnect();
} catch (IOException e) {
e.printStackTrace();
}
}
}
请问该如何正确使用java进行连接