Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-687

[FTPS] javax.net.ssl.SSLException: Unsupported or unrecognized SSL message

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.7
    • 3.7.1
    • FTP
    • None
    • Tested with JDK 8, 11, 13, 14

    Description

      After adding the self signed polynesie.cer certificate to JVM security (jdk-x.x.x/lib/security) :

      keytool.exe -import -storepass "changeit" -keystore "./cacerts" -alias polynesie.cer -file ./polynesie.cer -noprompt

       polynesie.cer obtained by copying certificate part from this command line result :

      openssl s_client -connect ftp0.gov.pf:21 -starttls ftp

      Trying to retrieve a file with ftpes :

      java -cp commons-net-examples-3.5.jar;commons-net-3.5.jar examples/ftp/FTPClientExample -A -p TLS,false -e -b ftp0.gov.pf DataVRS/fiche_Station_VRS_VAI1.pdf fiche_Station_VRS_VAI1.pdf

      Produce this exception :

      javax.net.ssl.SSLException: Unsupported or unrecognized SSL message
              at java.base/sun.security.ssl.SSLSocketInputRecord.handleUnknownRecord(Unknown Source)
              at java.base/sun.security.ssl.SSLSocketInputRecord.decode(Unknown Source)
              at java.base/sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
              at java.base/sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
              at java.base/sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
              at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
              at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
              at org.apache.commons.net.ftp.FTPSClient._openDataConnection_(FTPSClient.java:642)
              at org.apache.commons.net.ftp.FTPClient._retrieveFile(FTPClient.java:1907)
              at org.apache.commons.net.ftp.FTPClient.retrieveFile(FTPClient.java:1893)
              at testFTP2.FTPClientExample.main(FTPClientExample.java:513)
      

      It is probably the same error of ssl_reuse session as NET-408.

      Same try with ftp4j library reports this error :

      code=522, message= SSL connection failed; session reuse required: see require_ssl_reuse option in vsftpd.conf man page
      

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mguichar Mikael
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: