lrvtc.connectEx

With the support of HTTPS and NTLM authentication, this function provides a way to specify parameters such as username, 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.

ExampleGlobal Functions

Syntax

lrvtc.connectEx( {object} );

JavaScript Object

{  
    server:"<string>",
    port:"<string>",
    userName:"<string>",
    password:"<string>",
    domain:"<string>",
    cert:"<string>",
    key:"<string>",
    ca:"<string>"
}
Property NameDescription
server

The name or IP address of the VTS server host.

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

portThe port number.
userNameThe user name.
passwordThe password masked by the password encoding. A plain text password is also acceptable.
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

Returns zero on success or one of the Error Codes.

Parameterization

All string input arguments can be passed using standard parameterization.

Example

function vuser_init()
{
	lr.saveString("59eedbb995e42a1a","SandyPass");
	rc = lrvtc.connectEx (
	{
		server : 'https://localhost', 
		port : 8883, 
		userName : 'sandy',
		password: '{sandyPass}',
		domain: 'mydomain.net',
		ca: 'cacert_root.pem',
		cert: '../cert_wolf.pem',
		key: '../cert_wolf.pem'
	});
	lr.logMessage("Connect result rc="+ rc);
	return 0;
}