You can use the s_server utility to debug an SSL/TLS
client. By entering openssl s_server
at the command line,
you can run a simple SSL/TLS server that listens for incoming SSL/TLS
connections on a specified port. The server can be configured to provide
extensive logging and error reporting.
The options supported by the openssl s_server utility are as follows:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
When an SSL client is connected to the test server, you can enter any of the following single letter commands on the server side:
|
End the current SSL connection but still accept new connections. |
|
End the current SSL connection and exit. |
|
Renegotiate the SSL session. |
|
Renegotiate the SSL session and request a client certificate. |
|
Send some plain text down the underlying TCP connection. This should cause the client to disconnect due to a protocol violation. |
|
Print out some session cache status information. |
To use the s_server utility to debug SSL clients, start the test server with the following command:
openssl s_server -accept 9000 -cert servercert.pem
Where the test server listens on the IP port 9000 and
servercert.pem
is a file containing the server’s X.509
certificate in PEM format.
The s_server utility also provides a convenient way to test
a secure Web browser. If you start the s_server utility with
the -WWW
switch, the test server functions as a simple Web
server, serving up pages from the current directory; for example:
openssl s_server -accept 9000 -cert servercert.pem -WWW