Show TOC

Establishing a CBS Connection Locate this document in the navigation structure

Procedure

Many commands require that a valid CBS connection exists.

Example

Without a valid CBS connection, you receive an error message:

cbs>bsstate rtest1

Error: There is no valid CBS connection. The syntax of the command was correct. But as no valid connection to CBS existed, the command could not be executed.

  1. To create a CBS connection using the connect command, you have to specify (at least) the CBS URL.

  2. Enter a valid user/password combination. The following example shows the syntax of the connect command:

    Example

    cbs>connect -c http://server:port -u someuser -p rightpwd

    In case the specified user/password combination is not valid on the CBS, you get an error message.

    Caution

    When entering the connection parameters as shown above, the password is shown in plain text. Reading the password securely from the command line in Java applications is difficult for technical reasons.

    To enter the password securely, an input window is raised where you can enter the password securely if no password was specified using the command line. In the next example, the input window below is displayed after the connect command is entered as follows:

    cbs>connect -c http://server:port -u someuser

Additional Parameters for the connect Command

There are two additional options that can be used with regard to command connect:

  • You can use option -f to specify a keystore file for an SSL connection .

    In the examples above, the information that is sent to and received from CBS is not encrypted. If you want to encrypt the information that is sent and received, you have to use a keystore file to establish a SSL connection. Note that in case of a SSL connection, the URL for option -c differs from the one that is used in the non-SSL case:

    • HTTPS is used instead of HTTP.

    • Due to HTTPS a different port number is used as in case of HTTP:

      cbs>connect -c https://server:port -u someuser -p rightpwd -f key-storefile

  • Applying option -t you can specify the read timeout.

    The parameter for option -t is an integer that denotes the timeout in milliseconds. Option -t is of interest if you notice that commands abort due to read timeout.