Java Reference
In-Depth Information
Figure 17.2
Output of the GreetingServer program.
Figure 17.3
Output of the GreetingClient program.
Figure 17.2 shows the output of the GreetingServer program, which needs
to be executed first.
Figure 17.3 shows the output of the GreetingClient program. Notice that the
GreetingServer program does not terminate because it invokes accept() in an
infinite while loop. You can run the client again and again without having to
restart the server program.
Java Secure Socket Extension (JSSE)
A socket connection can be made using the Secure Sockets Layer (SSL) proto-
col, which provides a secure connection between the client and server. Using
SSL ensures a high level of security in regard to the data being sent between
the two computers. When you purchase an item online and send your credit
card number over the Internet, SSL is likely the security method used to
protect your credit card number from being seen and used maliciously.
Version 1.4 of the J2SE introduced new support for using SSL and sockets with
the Java Secure Socket Extension (JSSE). The classes involved in creating a secure
socket connection with JSSE are found in the javax.net and javax.net.ssl packages
and include the following:
javax.net.ssl.SSLServerSocket. Used by the server application to accept
client connections and create an SSLSocket. Compare this class to the
java.net.ServerSocket class.
javax.net.ssl.SSLSocket. Represents the secure socket on both the client
and the server. Compare this class to the java.net.Socket class.
Search WWH ::




Custom Search