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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access