Testing the SSL scenario
Set the environment variables then test the scenario by starting CICS® Transaction Gateway and sending an ECI request to the CICS server.
Set the environment variables
If you have not already done so, you must set the Java™ CLASSPATH environment variable so that the ctgclient.jar and ctgsamples.jar files can be found.
To set the CLASSPATH environment variable:
- Open a command prompt window and go to the directory where the Java keystore file is located.
- Set the Java CLASSPATH environment
variable by issuing the set CLASSPATH command, for example:
set CLASSPATH=<install_path>\classes\ctgclient.jar;<install_path>\classes\ctgsamples.jar;%CLASSPATH%
set CLASSPATH=<install_path>\classes\ctgclient.jar;<install_path>\classes\ ctgsamples.jar;%CLASSPATH%
Send an ECI request to CICS
When you send an ECI request from the Java client application EciB1 specifying the ssl:// protocol, an SSL handshake between the Java client and the Gateway daemon is attempted. When server authentication, and if configured, client authentication have been successful, the Gateway daemon lists the available CICS servers to forward the ECI request to. When you have selected your CICS server, the CICS application EC01 returns the current date and time.
The source for the EciB1 application is located in
the samples folder, for example:
<install_path>\samples\java\com\ibm\ctg\samples\eci
To
test the scenario:
- Start CICS Transaction Gateway.
- Send the ECI request to the CICS server
by issuing a Java command that
has the following format:
java com.ibm.ctg.samples.eci.EciB1 ssl://Gateway_URL Gateway_port_number jks_filename jks_password
For example:java com.ibm.ctg.samples.eci.EciB1 ssl://Gateway_URL Gateway_port_number jks_filename jks_password
java com.ibm.ctg.samples.eci.EciB1 ssl://server.company.com 8573 myclientkeyring.jks MyPassword
java com.ibm.ctg.samples.eci.EciB1 ssl://server.company.com 8573 myclientkeyring.jks MyPassword
- The command returns a list of CICS servers,
for example:
CICS Servers Defined: 1. CICSA -CICS V4.1 Server Choose Server to connect to, or q to quit:
- When prompted, type the number of the CICS server to which you want the ECI request sent.
The CICS server
returns the current date and time, for example:
Program EC01 returned with data:-
Hex: 32382f30312f31302031353a33323a34360
ASCII text: 28/01/10 15:32:46
You have now successfully
completed the scenario.