“Remote host closed connection during handshake” opening an HTTPS page with HTMLUnit

While trying to fetch the HTTPS page using HTML Unit 2.23 under Java 7, Ubuntu Linux, I received the following exception: Remote host closed connection during handshake

The code was the following


The problem was solved upgrading to Java 8.

I upgraded to Java 8 after reading Oracle’s blog about HTTPS debugging and copying the JCE files suggested there in the $JAVA_HOME/lib/security (nothing changed).

I decided to upgrade to java 8 after I saw this site about SSL Site debugging couldn’t connect using java 7 too.

During debugging I added this to the JRE arguments to see what’s was going on