ssltool

NAME

ssltool command line tool to explore SSL support in Java (JSSE)

SYNOPSIS

						ssltool
						command (help | [command-options])

Executes ssltool with the specified command.

						ssltool help
					

Displays all the commands available with ssltool.

						ssltool
						command
						help
					

Displays all the command-options available with the command.

						ssltool show –cs
					

Shows all the supported and enabled cipher suites.

						ssltool server [server-options]

Runs ssltool as a server program.

						ssltool client [client-options]

Runs ssltool as a client program.

						ssltool proxy [proxy-options]

Runs ssltool as a proxy (tunnel) program.

DESCRIPTION

The tool ssltool is a utility program to explore SSL support in the Java platform. It does so by running as a server, a client or a proxy program and by querying the Java platform on supported SSL protocols versions and cipher suites.

While running as server, it serves requests as per the incoming protocol, as specified by the option -inproto. When the incoming protocol is either TCP or SSL then the server listens for incoming connections. Once a connection is accepted, it spawns a thread to service messages on that connection. Action taken on receiving data bytes depends on the value of the options -mode and -action. For example, in the echo mode the server writes back whatever it receives to the same connection. In the bench mode, it can discard the received data (read-only action), write back the received data (read-write action), or simply wait for the connection to get closed (accept-wait action). Other supported incoming protocols are HTTP, HTTPS, RMI and SRMI (RMI over SSL). With HTTP and HTTPS, it simply returns the document specified by the requested URL and the value of –action is ignored. With RMI and SRMI, it runs an in-process rmiregistry and an RMI server class.

The client role is complementary to the server role, with the outgoing protocols (option –outproto) the same as incoming protocols supported by the server. With TCP and SSL protocols and echo mode, the client prompts the user to type a message, terminated by a new line, and sends the message to the server over the connection established during client initialization. With RMI and SRMI protocols, the message supplied as a byte array argument to the method call. In bench mode, the client writes bufsize bytes (write-only action), writes and reads bufsize bytes (write-read action), or simply opens and closes connections (open-close action) in a loop with the loop count specified by the option –num.

A proxy between a client and server can be used to analyze the TCP messages being exchanged. ssltool-based proxy operates at TCP level, so it can work with any client and server program. It waits for TCP connections at the port specified by the option –inport and forwards the connection to the target address specified by options –host and –port. The databytes exchanged can be analyzed by specifying one or more supported protocol analyzers. Currently, only two analyzers are supported: dd (data display) and ssl. The former simply displays the data exchanged as Hex bytes and the later parses the data as per SSL message definitions. Protocol analyzers are specified by option –patype. More than one analyzer can be specified by supplying a comma separated list as in –patype "dd,ssl".

Essentially, ssltool enables you to:

  • Query the Java platform for supported protocols and cipher suites.

  • Establish SSL connection and exchange data between any two machines connected by a TCP/IP network with the specified authentication and trusted certificates.

  • Perform HTTPS communication.

  • Perform RMI over SSL.

  • Benchmark SSL performance and compare it with TCP performance.

  • Analyze SSL protocol messages between any pair of SSL client and server.

OPTIONS for ssltool server

-inport portnoTCP port to accept incoming connection. Default: 9000. Valid for –inproto values of TCP, SSL, HTTP and HTTPS only. For –inproto values of RMI and SRMI, this is the port associated with the in-process rmi registry.
-inproto protoProtocol to accept and service requests. Valid values: TCP, SSL, HTTP, HTTPS, RMI and SRMI. Default: TCP. For protocols SSL, HTTPS and SRMI, system properties for keystore and truststore can be passed to the JVM by setting environment variable JSTK_OPTS.
-inetaddr addrIP address of the network interface card to be used for TCP and SSL communication. Default: none.
-mode modeMode to service the requests. Valid values: echo and bench. Default: echo.
-action actionValid for protocols TCP, SSL, RMI and SRMI in bench mode only. Possible values:

write-only: write but do not read

read-write: send back the data to the client.

accept-wait: for connection accept and wait for closing by the client. Not applicable to RMI and SRMI.

Default: read-only

-bufsize sizeSize of the buffer (in bytes) to read data. Default: 8192
-needcauthFlag to indicate mandatory client authentication. Applicable to SSL, HTTPS and SRMI protocols only.
-wantcauthFlag to indicate negotiation for client authentication. Applicable to SSL, HTTPS and SRMI protocols only.
-csfile filenameFile to read cipher suits to be enabled. The file with the specified filename contains the cipher suite symbolic names, one per line. Applicable to SSL, HTTPS and SRMI protocols only.
-nioFlag to indicate use of NIO buffers and socket calls for TCP based communication.
-verboseDisplay execution status. Helpful for debugging.

OPTIONS for ssltool client

-port portnoTCP port to make outgoing connection. Default: 9000. Valid for –outproto values of TCP and SSL only. For –outproto values of RMI and SRMI, this is the port used for RMI registry lookup.
-host hostnameHostname or IP address of the machine running the server program. Default: localhost. Valid for –outproto values of TCP and SSL only. For –outproto values of RMI and SRMI, this is the host used for RMI registry lookup.
-outproto protoProtocol to make requests. Valid values: TCP, SSL, RMI and SRMI. Default: TCP. For protocols SSL and SRMI, system properties for keystore and truststore can be passed to the JVM by setting environment variable JSTK_OPTS.
-inetaddr addrIP address of the network interface card to be used for TCP and SSL communication. Default: none.
-mode modeMode to make the requests. Valid values: echo and bench. Default: echo.
-action actionValid for protocols TCP, SSL, RMI and SRMI in bench mode only. Possible values:

write-only: write but do not read

write-read: write and read.

open-close: open and close connections. Not applicable to RMI and SRMI.

Default: write-only

-invalidateInvalidate the SSLSontext associated with the SSL connection. Used for benchmarking SSL connection setup overhead (-outproto ssl –mode bench –action open-close).
-bufsize sizeSize of the buffer (in bytes) to write data in bench mode. Default: 8192
-num numLoop count in bench mode. Default: 2048.
-url urlhttp or https URL to access. Other options such as –host, -port, -outproto, -action, -nio etc. are ignored.
-nioFlag to indicate use of NIO buffers and socket calls for TCP based communication.
-csfile filenameFile to read cipher suits to be enabled. The file with the specified filename contains the cipher suite symbolic names, one per line. Applicable to SSL, HTTPS and SRMI protocols only.
-verboseDisplay execution status. Helpful for debugging.

OPTIONS for ssltool proxy

-inport portnoTCP port to accept incoming connection. Default: 8995.
-port portnoTCP port to make outgoing connection. Default: 9000.
-host hostnameHostname or IP address of the target. Default: localhost.
-bufsize sizeSize of the buffer (in bytes) to read data. Default: 8192
-patype palistProtocol Analyzer types to analyze traffic. Default: none.

Valid values (can also specify a comma separated list ):

dd: didplay data as Hex bytes.

ssl: parse SSL record headers and handshake messages.

dd,ssl or ssl,dd
-nioFlag to indicate use of NIO buffers and socket calls for TCP based communication.
-verboseDisplay execution status. Helpful for debugging.

EXAMPLES

						ssltool server
					

Runs a server listening for TCP connections on port 9000. Displays information about accepted connections and received bytes. Writes back the received data to the connection. Enter Ctrl-C to terminate the program.

						ssltool client
					

Runs a client program that establishes a TCP connection to the server running on the same machine and listening for the connection at port 9000. Prompts the user to enter a message. Reads the message, sends it to the server, reads the response, and prints it on the screen. Enter quit at the prompt to exit the client.

						ssltool proxy –patype dd
					

Runs a proxy program that tunnels the connections targeted to port 8995 to the port 9000 on the same machine. Displays all the exchanged bytes in Hex. You should run the client by issuing command "ssltool client –port 8995" to connect to proxy in place of the server in the previous example. Enter Ctrl-C to terminate the program.

						sslsetup ss-certs
						sslsetup server-env
						ssltool server –inproto ssl
					

This sequence of commands creates keystore and truststore files, server.ks, client.ks, server.ts and client.ts in the current directory, populated with self-signed certificates for both client and server; sets proper values to the environment variable JSTK_OPTS and runs the server program to accept SSL connections.

						sslsetup client-env
						ssltool client –outproto ssl
					

Sets up the JSTK_OPTS environment variable for running the client ( assuming that the commands are executed on the same machine and from the same directory as the previous sequence of commands ) and runs the client to establish SSL connection with the server.

						ssltool server –inproto ssl –mode bench –action accept-wait –csfile cs.txt
					

Runs the server for benchmarking SSL connection setup overhead using the cipher suite listed in file cs.txt. Assumes that the JSTK_OPTS is set properly to accept SSL connections.

						ssltool client –outproto ssl –mode bench –action open-close –host venus –csfile
 cs.txt -invalidate
					

Runs the client for benchmarking SSL connection setup overhead to the server running on host venus using the cipher suite listed in file cs.txt. Assumes that the JSTK_OPTS is set properly to accept SSL connections.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.121.54