Search code examples
javaftps

javax.net.ssl.SSLException: Unsupported or unrecognized SSL message


I have a problem with a FTPS connection:

FTPSClient client = new FTPSClient(); 
client.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out))); 
client.connect(host);

and got this response:

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)

Has anyone an idea what is going wrong?


Solution

  • Update your commons-net-3.3.jar file. The older version has a bug or a problem with SSL on some Server.

    Mike