java - javax.net.ssl.SSLException:不支持或无法识别的 SSL 消息
问题描述
我的 FTPS 连接有问题:
FTPSClient client = new FTPSClient();
client.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out)));
client.connect(host);
并得到了这样的回应:
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 3 of 50 allowed.
220-Local time is now 10:21. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
AUTH TLS
234 AUTH TLS OK.
Mai 12, 2020 10:21:01 VORM. main
SEVERE: null
javax.net.ssl.SSLException: Unsupported or unrecognized SSL message
at java.base/sun.security.ssl.SSLSocketInputRecord.handleUnknownRecord(SSLSocketInputRecord.java:439)
at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:184)
at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:108)
at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1180)
at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1091)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402)
at org.apache.commons.net.ftp.FTPSClient.sslNegotiation(FTPSClient.java:269)
at org.apache.commons.net.ftp.FTPSClient._connectAction_(FTPSClient.java:211)
有谁知道出了什么问题?
解决方案
更新您的 commons-net-3.3.jar 文件。旧版本在某些服务器上存在错误或 SSL 问题。
麦克风
推荐阅读
- multithreading - 代码中的两个连接语句有什么区别?
- powershell - 根据输入参数集更改 powershell cmdlet 的输出对象的属性
- javascript - 单击提交按钮后如何获取成功消息
- c# - 在 WPF 的 TreeView 中,有没有办法获取所选子节点的索引和所选子项的父节点的索引
- c# - 我应该将 Using 语句与 HttpClient 一起使用吗?
- java - 如何在特定时间段内使用 ScheduledExecutorService 运行任务?
- android - 有没有办法在android中本地化棉花糖权限字符串?
- docker - 使用 NPM 脚本使用命令参数运行 docker
- angular - “视图 DOM”和“内容 DOM”有什么区别?
- dart - 滚动控制器未附加到任何滚动视图