lrvtc_connect_ex

With the support of HTTPS and NTLM authentication, this function provides a way to specify parameters such as username and password, during or before connecting to the VTS server.

Tip: To enable HTTPS without authentication, you can use lrvtc_connect, prefixing the URL for the server name with HTTPS.

C Language

VTCERR2 lrvtc_connect_ex("param1=value1","param2=value2",LAST);

C# Language

vts.connect_ex(string[] argumentList);

Java Language

Lrvtc.connect_ex(String[] argumentList);

  

ExamplesGlobal Functions

Arguments

NameComments
Server

The name or IP address of the VTS server host.

HTTP is assumed by default, unless the URL begins with HTTPS.

Port

The port number of the instance.

If the Instance parameter is specified, this is the UI port number.

Instance

Version support: This argument is supported from version 24.3.

(Optional) Identify the instance using the VTS instance name.

When providing the Instance parameter, the Port parameter should specify the UI port number. If the UI port number is 4000 (default), then Port can be ignored.

For example, with UI port 4000:

int rc = lrvtc_connect_ex("Server=https://mymachine.aws.win.net",
"Instance=order",
LAST );

With a different UI port:

int rc = lrvtc_connect_ex("Server=https://mymachine.aws.win.net",
"Port=9002",
"Instance=order",
LAST );

For the main instance, use Default or Main.

UserNameThe user name.
PasswordThe password masked by the Password Encoder. A plain text password is also acceptable. For more information, see the Virtual User Generator Help Center (select the relevant version).
Domain

Domain name.

Applicable only when the server uses NTLM authentication.

Cert

(Optional) The certificate chain in PEM format.

Required if server demands client authentication.

Note: Must be a valid relative or absolute file path, and can be specified in a format supported by the operating system. For example:

  • Linux: /path/to/file
  • Windows: c:/path/to/file or c:\path\to\file
Key

(Optional) Private keys in PEM format.

Required if server demands client authentication.

Note: Must be a valid relative or absolute file path, and can be specified in a format supported by the operating system. For example:

  • Linux: /path/to/file
  • Windows: c:/path/to/file or c:\path\to\file
CA

(Optional) Overrides the trusted CA certificates.

Required if client wants to verify server certificate.

Note: Must be a valid relative or absolute file path, and can be specified in a format supported by the operating system. For example:

  • Linux: /path/to/file
  • Windows: c:/path/to/file or c:\path\to\file

Return Values

C Language:   Returns zero on success or one of the Error Codes.

C# Language: Returns true on success.

Java Language:   Returns zero on success or one of the Error Codes.

Parameterization

All string input arguments can be passed using standard parameterization.

C Language Example

vuser_init()
{
	int   rc;
	lr_save_string("59eedbb995e42a1a","SandyPass");
	rc = lrvtc_connect_ex("Server=https://localhost",
				"Port=8883",
				"Instance=order", 
				"UserName=sandy",
				"Password={sandyPass}",
				"Domain=mydomain.net",
				"CA=cacert_root.pem",
				"Cert=../cert_wolf.pem",
				"Key=../cert_wolf.pem",
				LAST );
	lr_log_message("Connect result rc=%d\n", rc);
	return 0;

}

C# Language Example

vts.connect_ex(new string[]{
	"Server=https://localhost",
	"Port=8883", 
	"Instance=order",
	"UserName=sandy",
	"Password={sandyPass}",
	"Domain=mydomain.net",
	"CA=cacert_root.pem",
	"Cert=../cert_wolf.pem",
	"Key=../cert_wolf.pem"
});

Java Language Example

Lrvtc.connect_ex(new String[]{
		"Server=https://localhost",
		"Port=8883",
		"Instance=order",
		"UserName=sandy",
		"Password={sandyPass}",
		"Domain=mydomain.net",
		"CA=cacert_root.pem",
		"Cert=../cert_wolf.pem",
		"Key=../cert_wolf.pem"
});