Sending a Secured Request and Getting a Secured Response From a Web Site

A secured HTTP request is sent to a web server. Mutual authentication takes place between the web server and client. After the authentication is successful, the web server sends valid response to the client completing the handshake.

Prerequisites

Your computer must be connected to the Internet.

Copy the certificates to the c:/tmp folder on Windows and /tmp folder on Unix by unzipping the JKS folder packaged with the sample.

Procedure

  1. In the samples directory, select palette > http > SecuredRequestResponse and double-click tibco.bw.sample.palette.http.SecuredRequestResponse. For more information, see Accessing Samples.
  2. In the Project Explorer view, expand the tibco.bw.sample.palette.http.SecuredRequestResponse project.
  3. Set the default ApplicationProfile to match the OS you are running on. For more information, see Setting the Default Application Profile.
  4. Fully expand the Processes directory and double-click ClientRequest.bwp.
  5. Click Run > Debug Configurations.
  6. At the left hand tree of Debug Configuration wizard, expand BusinessWorks Application and select BWApplication.
  7. Click the Applications tab and then click the Deselect All button if you have multiple applications. Select the check box next to tibco.bw.sample.palette.http.SecuredRequestResponse.application.
  8. Click Debug.
    This runs the sample in Debug mode.
  9. Click the Terminate icon to stop the process.

Result

A SecuredRequestResponse.log file is created at C:\tmp\SecuredRequestResponse directory unless you have changed its location in the Module Properties dialog. The following is the expected output:

Response received from BW HTTPS Server!!!

Understanding the Configuration

The HttpClientResource and the HttpConnectorResource is defined to listen on port 13003. To change the port, specify a new Port value in the Module Property dialog. If you want to change the default location of the OUTPUT_FILE, KEYSTORE_URL_CLIENT, KEYSTORE_URL_SERVER and HOST, specify it in the Module Property dialog box.

The HTTP Receiver process starter listens on the connection specified by the HTTPConnectorResource shared resource. Verify the path of the client and server certificates defined in the Module Properties dialog box.



For the SSLClientResource and the SSLServerResource make sure you have provided correct entries for all the fields as shown in the following image.



The secured HTTP request is sent to the server. Mutual authentication happens between the Server and Client. After a successful authentication, the Server sends a valid response to Client, completing the handshake.