Hello everybody.
I am new in this forum, I hope I'm writing without violate any rule.

I am also new in ssl connection, I'm testing a new product (new keystore) in java and I have some questions.

First question: activating ssl debug (with option -Djavax.net.debug=all) the output show all ssl handshake message twice. I have two client hello, two server hello.
After server hello starts

ClientKeyExchange, RSA PreMasterSecret, TLSv1

and also this message arrives twice.

The handshake terminates with this error

NioProcessor-1, fatal error: 40: bad handshake record MAC
javax.net.ssl.SSLHandshakeException: bad handshake record MAC

and now I don't understand what's happening.
I think it is not normal read all handshake messages twice, but now I don't know what to do.

Second question: since I read all messages twice, the error may be generated by the server reading second message (encrypted with different key)?

I'm using apache FtpsServer.