Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
options.certificateFile = options.certificateFile || path.join(__dirname, "../certificates/client_selfsigned_cert_2048.pem");
options.privateKeyFile = options.privateKeyFile || path.join(__dirname, "../certificates/PKI/own/private/private_key.pem");
// istanbul ignore next
if (!fs.existsSync(options.certificateFile)) {
throw new Error(" cannot locate certificate file " + options.certificateFile);
}
// istanbul ignore next
if (!fs.existsSync(options.privateKeyFile)) {
throw new Error(" cannot locate private key file " + options.privateKeyFile);
}
OPCUASecureObject.call(this, options);
// must be ZERO with Spec 1.0.2
this.protocolVersion = 0;
this._sessions = [];
this._server_endpoints = [];
this._secureChannel = null;
this.defaultSecureTokenLifetime = options.defaultSecureTokenLifetime || 600000;
this.tokenRenewalInterval = options.tokenRenewalInterval || 0;
assert(_.isFinite(this.tokenRenewalInterval) && this.tokenRenewalInterval >= 0);
/**
* @property securityMode
* @type MessageSecurityMode