IOExceptionjavax.net.ssl.SSLException: Unexpected end of handshake data

5 messages Options
Embed this post
Permalink
Chetan-16

IOExceptionjavax.net.ssl.SSLException: Unexpected end of handshake data

Reply Threaded More More options
Print post
Permalink
Hi,

I'm trying to make a ftps connection to a server using apache's ftps client,
but getting a expection when trying to make the connection.

IOExceptionjavax.net.ssl.SSLException: Unexpected end of handshake datajavax.net.ssl.SSLException: Unexpected end of handshake data

Can someone help with this.

Here is the expection

Trying to connect
ftps client created
Just before connectIOExceptionjavax.net.ssl.SSLException: Unexpected end of handshake datajavax.net.ssl.SSLException
at com.sun.net.ssl.internal.ssl.HandshakeInStream.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.HandshakeMessage$CertificateMsg.<init>(Unknown Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at org.apache.commons.net.ftp.FTPSClient.sslNegotiation(
at org.apache.commons.net.ftp.FTPSClient._connectAction_(
at org.apache.commons.net.SocketClient.connect(
at com.accenture.ftps.trail.FtpsTrailClass.main(: Unexpected end of handshake dataFTPSClient.java:240)FTPSClient.java:171)SocketClient.java:178)FtpsTrailClass.java:35)

here is the code

int reply;
    System.out.println("Trying to connect");
    FTPSClient ftps = new FTPSClient("SSL");
    
    System.out.println("ftps client created");
    
    //ftps.setAuthValue("SSL");
    System.out.println("Just before connect");
    
    ftps.connect("XXXXX",21);
    
    System.out.println("Connected");
            
    reply = ftps.getReplyCode();
 
             if (!FTPReply.isPositiveCompletion(reply))
             {
                 ftps.disconnect();
                 System.err.println("FTP server refused connection.");
                 System.exit(1);
             }
    //ftps.setDefaultTimeout(1000);
    //ftps.enterRemotePassiveMode();
    
    System.out.println("Before login");
    ftps.login("xxxx","xxxx");
    System.out.println("Connected to server"); 
 
Thanks in advance
Chetan


Steve Cole-6

Re: IOExceptionjavax.net.ssl.SSLException: Unexpected end of handshake data

Reply Threaded More More options
Print post
Permalink
Does the server require the client to use a certificate for authentication?
If so, are you setting the FTPSClient KeyManager using a keystore that
contains the correct signed certificate?

----- Original Message -----
From: "Chetan" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, April 16, 2009 9:49 PM
Subject: IOExceptionjavax.net.ssl.SSLException: Unexpected end of handshake
data


Hi,

I'm trying to make a ftps connection to a server using apache's ftps client,
but getting a expection when trying to make the connection.

IOExceptionjavax.net.ssl.SSLException: Unexpected end of handshake
datajavax.net.ssl.SSLException: Unexpected end of handshake data

Can someone help with this.

Here is the expection

Trying to connect
ftps client created
Just before connectIOExceptionjavax.net.ssl.SSLException: Unexpected end of
handshake datajavax.net.ssl.SSLException
at com.sun.net.ssl.internal.ssl.HandshakeInStream.read(Unknown Source)
at
com.sun.net.ssl.internal.ssl.HandshakeMessage$CertificateMsg.<init>(Unknown
Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown
Source)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown
Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at org.apache.commons.net.ftp.FTPSClient.sslNegotiation(
at org.apache.commons.net.ftp.FTPSClient._connectAction_(
at org.apache.commons.net.SocketClient.connect(
at com.accenture.ftps.trail.FtpsTrailClass.main(: Unexpected end of
handshake
dataFTPSClient.java:240)FTPSClient.java:171)SocketClient.java:178)FtpsTrailC
lass.java:35)

here is the code

int reply;
System.out.println("Trying to connect");
FTPSClient ftps = new FTPSClient("SSL");

System.out.println("ftps client created");

//ftps.setAuthValue("SSL");
System.out.println("Just before connect");

ftps.connect("XXXXX",21);

System.out.println("Connected");

reply = ftps.getReplyCode();

if (!FTPReply.isPositiveCompletion(reply))
{
ftps.disconnect();
System.err.println("FTP server refused connection.");
System.exit(1);
}
//ftps.setDefaultTimeout(1000);
//ftps.enterRemotePassiveMode();

System.out.println("Before login");
ftps.login("xxxx","xxxx");
System.out.println("Connected to server");

Thanks in advance
Chetan




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Chetan-16

Re: IOExceptionjavax.net.ssl.SSLException: Unexpected end of handshake data

Reply Threaded More More options
Print post
Permalink
Hi Steve,

The server does not require the client to use certificate, Just using username and password.
The certificate is at the server level.

Thanks
Chetan
 
________________________________

Imagination is more important than knowledge.
Take care,
Cheers,
Chetan




________________________________
From: Steve Cole <[hidden email]>
To: Commons Users List <[hidden email]>
Sent: Friday, 17 April, 2009 20:45:15
Subject: Re: IOExceptionjavax.net.ssl.SSLException: Unexpected end of handshake data

Does the server require the client to use a certificate for authentication?
If so, are you setting the FTPSClient KeyManager using a keystore that
contains the correct signed certificate?

----- Original Message -----
From: "Chetan" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, April 16, 2009 9:49 PM
Subject: IOExceptionjavax.net.ssl.SSLException: Unexpected end of handshake
data


Hi,

I'm trying to make a ftps connection to a server using apache's ftps client,
but getting a expection when trying to make the connection.

IOExceptionjavax.net.ssl.SSLException: Unexpected end of handshake
datajavax.net.ssl.SSLException: Unexpected end of handshake data

Can someone help with this.

Here is the expection

Trying to connect
ftps client created
Just before connectIOExceptionjavax.net.ssl.SSLException: Unexpected end of
handshake datajavax.net.ssl.SSLException
at com.sun.net.ssl.internal.ssl.HandshakeInStream.read(Unknown Source)
at
com.sun.net.ssl.internal.ssl.HandshakeMessage$CertificateMsg.<init>(Unknown
Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown
Source)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown
Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at org.apache.commons.net.ftp.FTPSClient.sslNegotiation(
at org.apache.commons.net.ftp.FTPSClient._connectAction_(
at org.apache.commons.net.SocketClient.connect(
at com.accenture.ftps.trail.FtpsTrailClass.main(: Unexpected end of
handshake
dataFTPSClient.java:240)FTPSClient.java:171)SocketClient.java:178)FtpsTrailC
lass.java:35)

here is the code

int reply;
System.out.println("Trying to connect");
FTPSClient ftps = new FTPSClient("SSL");

System.out.println("ftps client created");

//ftps.setAuthValue("SSL");
System.out.println("Just before connect");

ftps.connect("XXXXX",21);

System.out.println("Connected");

reply = ftps.getReplyCode();

if (!FTPReply.isPositiveCompletion(reply))
{
ftps.disconnect();
System.err.println("FTP server refused connection.");
System.exit(1);
}
//ftps.setDefaultTimeout(1000);
//ftps.enterRemotePassiveMode();

System.out.println("Before login");
ftps.login("xxxx","xxxx");
System.out.println("Connected to server");

Thanks in advance
Chetan




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


Steve Cole-6

Re: IOExceptionjavax.net.ssl.SSLException: Unexpected end of handshake data

Reply Threaded More More options
Print post
Permalink
Verify the server supports explicit SSL, not implicit.

Verify you should be setting the protocol to SSL instead of the default TLS.

Also, what version of commons-net are you using, 1.4.1 or 2.0?

----- Original Message -----
From: "Chetan" <[hidden email]>
To: "Commons Users List" <[hidden email]>
Sent: Sunday, April 19, 2009 11:15 PM
Subject: Re: IOExceptionjavax.net.ssl.SSLException: Unexpected end of
handshake data


Hi Steve,

The server does not require the client to use certificate, Just using
username and password.
The certificate is at the server level.

Thanks
Chetan

________________________________

Imagination is more important than knowledge.
Take care,
Cheers,
Chetan




________________________________
From: Steve Cole <[hidden email]>
To: Commons Users List <[hidden email]>
Sent: Friday, 17 April, 2009 20:45:15
Subject: Re: IOExceptionjavax.net.ssl.SSLException: Unexpected end of
handshake data

Does the server require the client to use a certificate for authentication?
If so, are you setting the FTPSClient KeyManager using a keystore that
contains the correct signed certificate?

----- Original Message -----
From: "Chetan" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, April 16, 2009 9:49 PM
Subject: IOExceptionjavax.net.ssl.SSLException: Unexpected end of handshake
data


Hi,

I'm trying to make a ftps connection to a server using apache's ftps client,
but getting a expection when trying to make the connection.

IOExceptionjavax.net.ssl.SSLException: Unexpected end of handshake
datajavax.net.ssl.SSLException: Unexpected end of handshake data

Can someone help with this.

Here is the expection

Trying to connect
ftps client created
Just before connectIOExceptionjavax.net.ssl.SSLException: Unexpected end of
handshake datajavax.net.ssl.SSLException
at com.sun.net.ssl.internal.ssl.HandshakeInStream.read(Unknown Source)
at
com.sun.net.ssl.internal.ssl.HandshakeMessage$CertificateMsg.<init>(Unknown
Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown
Source)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown
Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at org.apache.commons.net.ftp.FTPSClient.sslNegotiation(
at org.apache.commons.net.ftp.FTPSClient._connectAction_(
at org.apache.commons.net.SocketClient.connect(
at com.accenture.ftps.trail.FtpsTrailClass.main(: Unexpected end of
handshake
dataFTPSClient.java:240)FTPSClient.java:171)SocketClient.java:178)FtpsTrailC
lass.java:35)

here is the code

int reply;
System.out.println("Trying to connect");
FTPSClient ftps = new FTPSClient("SSL");

System.out.println("ftps client created");

//ftps.setAuthValue("SSL");
System.out.println("Just before connect");

ftps.connect("XXXXX",21);

System.out.println("Connected");

reply = ftps.getReplyCode();

if (!FTPReply.isPositiveCompletion(reply))
{
ftps.disconnect();
System.err.println("FTP server refused connection.");
System.exit(1);
}
//ftps.setDefaultTimeout(1000);
//ftps.enterRemotePassiveMode();

System.out.println("Before login");
ftps.login("xxxx","xxxx");
System.out.println("Connected to server");

Thanks in advance
Chetan




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Radika Apte

Re: IOExceptionjavax.net.ssl.SSLException: Unexpected end of handshake data

Reply Threaded More More options
Print post
Permalink
In reply to this post by Chetan-16
Does the server require the client to use a authentication certificate?

Chetan-16 wrote:
Hi,

I'm trying to make a ftps connection to a server using apache's ftps client,
but getting a expection when trying to make the connection.

IOExceptionjavax.net.ssl.SSLException: Unexpected end of handshake datajavax.net.ssl.SSLException: Unexpected end of handshake data

Can someone help with this.

Here is the expection

Trying to connect
ftps client created
Just before connectIOExceptionjavax.net.ssl.SSLException: Unexpected end of handshake datajavax.net.ssl.SSLException
at com.sun.net.ssl.internal.ssl.HandshakeInStream.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.HandshakeMessage$CertificateMsg.<init>(Unknown Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at org.apache.commons.net.ftp.FTPSClient.sslNegotiation(
at org.apache.commons.net.ftp.FTPSClient._connectAction_(
at org.apache.commons.net.SocketClient.connect(
at com.accenture.ftps.trail.FtpsTrailClass.main(: Unexpected end of handshake dataFTPSClient.java:240)FTPSClient.java:171)SocketClient.java:178)FtpsTrailClass.java:35)

here is the code

int reply;
    System.out.println("Trying to connect");
    FTPSClient ftps = new FTPSClient("SSL");
    
    System.out.println("ftps client created");
    
    //ftps.setAuthValue("SSL");
    System.out.println("Just before connect");
    
    ftps.connect("XXXXX",21);
    
    System.out.println("Connected");
            
    reply = ftps.getReplyCode();
 
             if (!FTPReply.isPositiveCompletion(reply))
             {
                 ftps.disconnect();
                 System.err.println("FTP server refused connection.");
                 System.exit(1);
             }
    //ftps.setDefaultTimeout(1000);
    //ftps.enterRemotePassiveMode();
    
    System.out.println("Before login");
    ftps.login("xxxx","xxxx");
    System.out.println("Connected to server"); 
 
Thanks in advance
Chetan