HTTP/2 Transport Protocol

The Virtual Service Image Recorder can record using the HTTP/2 transport protocol. You can virtualize HTTP/2 for stateless REST transactions over a secure connection using APLN.
DevTest Solutions supports HTTP/2 for the following features using the DevTest Workstation only:
  • Creating a virtual service image by recording
  • Creating a virtual service model
  • Customizing a virtual service model with a Virtual Service Environment step
  • Using a proxy with a netty proxy server only
The following functionality is not supported for HTTP/2:
  • Creating a virtual service from RR pairs
  • Creating a virtual service from a specification (Swagger, WSDL, WADL, PCAP, RAML, etc.)
  • Customizing a virtual service model using Web/Web services or webMethods step, etc., w/ HTTP2
  • Testing HTTP/2 based functionality with Application Test
  • Working with HTTP/2 functionality in the DevTest Portal and the APIs
Follow these steps:
  1. To start recording a new virtual service image, complete one of the following steps:
    • Click
      VSE Recorder
      Lightning bolt.png on the main toolbar.
    • Right-click the
      VirtualServices
      node on the
      Project
      panel and select
      Create a VS Image
      ,
      by Recording
      .
    The
    Virtual Service Image Recorder
    opens.
  2. Complete the Basics Tab as in the following graphic:
    HTTP2 protocol selection
  3. Click Next.
  4. Enter the port and host information for this step.
    • Listen/Record on port
      Defines the port on which the client communicates to DevTest. 8001 is typical, but you can use another port number. Do not enter the http:// or https:// prefix.
    • T
      arget port
      Defines the target port number listened to by the server. Leave this field blank if you will select a Proxy passthrough style.
      Defaults
      : 80 (HTTP) and 443 (HTTPS)
    • Recorder pass-through style
      Specifies how the
      VS Image Recorder
      acts during recording. The choices are
      Gateway
      and
      Proxy
      . If you select
      Proxy
      , the contents in
      Target host
      and
      Target port
      fields are cleared and the fields become disabled. This choice affects how the client connects in the recording mode.
      • If
        VS Image Recorder
        listens in a gateway mode, the client must send HTTP requests directly to the recorder and not to the server. If the client is a browser, the URL contains the host and port of the recorder instead of the host and port of the server. SSL to Server and SSL to Client are always enabled, because HTTP/2 treats SSL as mandatory.
      • If
        VS Image Recorder
        listens in a proxy mode, the client must specify the recorder host and port as the proxy. If the client is a browser, then the URL contains the host and port of the server. The proxy settings must be set to route the request through the recorder. For HTTP/2, we only support using a pure HTTP/2 proxy.
      • Most of the HTTP clients have a setting for NOT using proxy for localhost. If your
        VS Image Recorder
        is running on localhost in proxy mode, disable this setting for the traffic to get correctly passed through the recorder.
    • Do not modify host header parameter received from client
      Specifies whether to pass through the value of the
      Host
      parameter. This option is only available when recording in Gateway mode. The pass-through option instructs the recorder not to rewrite the Host header parameter when resending traffic to the target endpoint.
      SSL Client (Server-Facing) Settings
      These settings are used to specify whether DevTest uses HTTPS to send requests to the server, which is required for HTTP/2. The options that are configured here are also applied to the
      HTTP/S Live Invocation Step
      of the virtual service that is generated by the recording.
      • Use SSL to server
        • Specifies whether DevTest uses HTTPS to send requests to the server. This is mandatory for HTTP/2.
      • SSL keystore file
        • Specifies the name of the client-side keystore file.  DevTest uses this keystore when using an HTTPS connection to the server.
        • By default, the
          ssl.client.cert.path
          property is used for the client-side keystore file.  This property can also be selected from the
          Defaults
          section of the dropdown list.
      • Keystore password
        • Specifies the password associated with the specified client-side keystore file.
        • You can specify the password directly using the Password Editor option, or you can use the DevTest Property Reference Editor option to specify a property expression that will be evaluated to provide the password.
        • By default, the property expression
          {{ssl.client.cert.pass}}
          is used for the client-side keystore password.  This property expression can be selected from the
          Defaults
          section of the dropdown list.
      SSL Server (Client-Facing) Settings
      These settings are used to specify whether DevTest acts as an SSL server with a custom keystore during recording and playback. This is required for HTTP/2. The settings that are configured here are also applied to the
      HTTP/S Listen Step
      of the virtual service that the recording generates.
      • Use SSL to client
        • Specifies whether DevTest uses a custom keystore when acting as an SSL server during recording and playback. This is mandatory for HTTP/2.
        • An HTTPS connection is used between the client and DevTest for recording. You can also specify a custom server-side keystore file and password that is associated with it.
      • SSL keystore file
        • Specifies the name of the server-side keystore file. DevTest uses this keystore when handling HTTPS connections from the client.
        • By default, the
          ssl.server.cert.path
          property is used for the server-side keystore file.  This property can also be selected from the
          Defaults
          section of the dropdown list.
      • Keystore password
        • Specifies the password that is associated with the specified server-side keystore file.
        • You can specify the password directly using the Password Editor option, or you can use the DevTest Property Reference Editor option to specify a property expression that will be evaluated to provide the password.
        • By default, the property expression
          {{ssl.server.cert.pass}}
          is used for the server-side keystore password.  This property expression can be selected from the
          Defaults
          section of the dropdown list.
      • Enable Client Certificate Authentication
        • Specifies whether a request should be sent to the client for their certificate during the SSL handshake. The following options determine what to do with the client certificate.
        • Request Client Certificate
          DevTest requests a client certificate during the SSL handshake without requiring that one is sent back.
          This is the default option when client certificate authentication is enabled.
        • Require Client Certificate
          DevTest requires a valid client certificate during the SSL handshake. If the client does not send back a certificate or it is invalid, then DevTest stops the SSL handshake and the connection fails.
      In a two-way SSL environment, see Virtualizing Two-way SSL Connections
      .
  5. Click
    Next
    .
    The
    VS Image Recorder
    starts recording the traffic. The assigned port and service target display on this window, unless you are using a proxy, in which case they are blank.
  6. To send the requests to the server routed through the
    VS Image Recorder
    to start recording traffic, use your HTTP client.
    As the VS Image Recorder records transactions, the dynamic display statistics on the lower portion of the window increase. The options and dynamic display statistics include:
    • Total conversations
      Displays the number of conversations recorded.
    • Total transactions
      Displays the number of transactions recorded.
    • Clear
      Clears the list of currently recorded transactions.
  7. When you have completed the recording, click
    Next
    to move to the next step.
    If you click
    Next
    and no transactions were recorded, an error message appears. Click
    OK
    to continue recording.
    If the transactions are not recorded, you could have a port conflict. The client sends transactions to the application instead of the
    Virtual Service Recorder
    . If another service is using that port, either stop that service or change the port setting so there is no longer a conflict.
    The
    Transactions
    tab displays a list of the most recent transactions recorded. On this list of transactions, you can double-click a transaction and can see a dialog showing the content of the transaction.
  8. Verify the base path and update it if necessary.
  9. To require a bind-to-port step before processing requests, select the
    A separate bind-to-port step is required
    check box.
  10. Click
    Next
    .
    HTTP2 Data Protocols
  11. Do not select any value for the data protocol on the next window and click
    Next.
    HTTP2 Conversations
  12. If no conversations were detected during the recording process, select transactions that start conversations. For token-based conversations, specify where tokens can be found. Use the
    Token Identification
    area in the
    VS Image Recorder
    . Select the transactions that start conversations and identify the session tokens. To designate the
    getNewToken
    Conversation Starter Transaction listed as a conversation starter, select it and click the blue arrow.
    The step components include:
    • Conversation Starter Transactions
      Lists the transactions that you have selected as conversation starters. To move the transaction to the Remaining Transactions list (if you do not want it to be a conversation starter), select a transaction and click the arrow.
    • Remaining Transactions
      Lists the recorded transactions. To move the transaction to the Conversation Starter Transactions list, select a transaction and click the arrow.
    • Plus icon
      Selects all transactions in the list (either Conversation Starters or Remaining) that are like a selected transaction. To move all the selected transactions, use the appropriate arrow button.
    • Conversation count
      Displays the number of conversations in the recording. As you build conversations, the number increases.
    • Force stateless
      From the
      Remaining Transactions
      list, select any transactions that should stay stateless and select the check box. For example, you could decide that a transaction that includes an image should stay stateless even though it contains a conversation starter token.
    • Stateless Transactions
      Click to see a list of all transactions that remain stateless, assuming the identified conversations on this panel. You can use the list to verify that you have identified all the conversation starter transactions.
    • Save
      Click to save the raw recorded transactions. Click
      Browse
      to navigate to the location in which to save the file. You can import the raw traffic recording in the
      Basics
      tab before beginning a new recording.
    • Response
      For the currently selected transaction, this field identifies which of its responses to look in. In general, 1 is the only option.
    • Look in
      This field identifies the piece of the response you want to see when looking for conversation tokens. The drop-down list contains an entry for each of Meta data entries in the response, plus one for the body of the response.
    • Token Identification area
      Based on the selected transaction and response, the content of the selected Look in section of the response is displayed here.
      • To mark a piece of the text as a conversation token, select the text and click the red rubber stamp icon. The text is then highlighted in yellow.
      • To mark the text as no longer a conversation token, either mark a different piece of the text or click
        Erase
        .
      • After you mark a token, you can use the
        Search
        icon to find similar transactions and mark their tokens. To open a dialog where you can select text (such as XML tags) that bound the conversation token, click
        Search
        . To specify the leading and trailing text to search for, use this method.
  13. Click
    Next
    .
    During post processing, the
    VS Image Recorder
    displays the processing status. As part of the preparation for writing the .vsi file, the recorder verifies request and response bodies to ensure that, if they are marked as text, that they are text. If they are not, the type is switched to binary.
    The recorder completes post processing the recording.
    To save the settings on this recording to load into another image recording, click
    Save
    Save icon.png above the
    Finish
    button.
  14. Click
    Finish
    to store the image.
  15. Review and save the virtual service model in DevTest Workstation.
    HTTP2 Service Image
After you deploy the virtual service, you can send requests to the service and monitor its traffic from the DevTest Workstation or DevTest Portal.
HTTP2 Portal
Add HTTP/2 Proxy to Properties File
If you are using a HTTP/2 proxy server, define it in the local.properties file in the LISA_HOME directory.
Follow these steps:
  1. Log on to the DevTest Server and navigate to LISA_HOME.
  2. Open the local.properties file. If it does not exist, copy the _local.properties file and save it as local.properties (without the underscore).
  3. Find the HTTP/2 Proxy Server section, and enter your proxy server details (by FDQN or IP address and port):
    HTTP2 Proxy Settings The last two lines are optional properties that default to null. The credential property is encrypted if you use it.
  4. Uncomment the lines that you used.
  5. Save and close the file.