O'Reilly logo

J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software by Art Taylor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The SSLClient Class

The SSLClient class is used to demonstrate the SSL server program shown previously. This class uses the JSSE package to create a SSLSocket, a client socket that connects to the server socket specified.

The work required to create the SSLSocket is performed in the constructor of the class. In the main program block, the no-arg constructor for the SSLClient class is called. The reference returned contains a reference to the SSLSocketFactory class which is used to make a call to the createSocket method. This method returns a SSLSocket opened on port 1500 on the host localhost.

Unlike the standard java.net Socket, the SSLSocket must start the handshaking process that will initiate SSL security. This is done with a call to the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required