Transport Level Security

  1. Open a terminal window.
  2. Cd to home, and execute the following command:
keytool -genkeypair -alias mycert -keysize 1024 -keyalg RSA -keypass skpass -storepass sspass -storetype JKS -keystore serviceKeystore.jks -dname cn=localhost
general_info_polished.png We are using keytool again, but in this case to create a digital (self-signed) certificate.
  1. Back in JBDS, expand Lab12 project, and double-click on camel-context.xml.
  2. Click on the Source tab.
  3. Locate the <camelContext> element and position above it.
  4. Copy and paste the following XML code:
<sslContextParameters id="sslContextParameters" xmlns="http://camel.apache.org/schema/spring"&gt;
general_info_polished.png The sslContextParameteres bean defines the SSL protocols to use and the location and characteristics of the key store that holds the SSL server certificate.

  1. Click on the Design tab.
  2. Click on Routes -> Add Route.
  3. In the new empty canvas, drag and drop a Generic component from the Components palette.
  4. Click on the Generic component and on the Properties tab.
  5. In the URI, enter the following value:
jetty:https://0.0.0.0:8282/services?matchOnUriPrefix=true&sslContextParametersRef=sslContextParameters
general_info_polished.png The jetty component provides HTTP-based endpoints for consuming and producing HTTP requests. That is, the Jetty component behaves as a simple Web server or can also be used as a http client (camel producer).
general_info_polished.png
  1. Drag and drop a Transform component from the Transformation palette.
  2. Create a link between the jetty and the transform components.
  3. Click on the transform component and the Properties tab.
  4. Select constant as language.
  5. Enter “<html><body>Hello from JBoss Fuse</body></html>” as the expression.

  1. Save the file (Ctrl+S).
  2. Right-click on the Lab12 project, “Run As” -> “Maven build” to deploy the profile.
  3. Once the profile is successfully deployed in Fuse, go back to the console.
  4. Click on the Profiles tab.
  5. Search for the lab12Profile and click on the details.. link.

  1. Click on the Refresh button.

  1. Click on Assign button.
  2. Select the root container and click assign.
  3. Open a new browser tab.
  4. Go to https://localhost:8282/services.
  5. Click on “Advanced” button.

  1. Click on Add Exception..
  2. Uncheck the “Permanently store this exception”.
  3. Click on the “Confirm Security Exception” button.

  1. You should see the welcome message using a secure channel.

results matching ""

    No results matching ""