Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-opcua-certificate-manager

Package Overview
Dependencies
Maintainers
1
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-opcua-certificate-manager - npm Package Compare versions

Comparing version 2.19.0 to 2.20.0

20

dist/certificate_manager.js

@@ -30,3 +30,3 @@ "use strict";

keySize: 2048,
location,
location
};

@@ -42,13 +42,13 @@ super(_options);

const statusCode = node_opcua_status_code_1.StatusCodes[status];
// console.log("StatusCode = ", statusCode.toString());
debugLog("checkCertificate => StatusCode = ", statusCode.toString());
if (statusCode === node_opcua_status_code_1.StatusCodes.BadCertificateUntrusted) {
const thumbprint = node_opcua_crypto_1.makeSHA1Thumbprint(certificate).toString("hex");
if (this.automaticallyAcceptUnknownCertificate) {
errorLog("automaticallyAcceptUnknownCertificate = true");
errorLog("certificate with thumbprint " + thumbprint + " is now trusted");
debugLog("automaticallyAcceptUnknownCertificate = true");
debugLog("certificate with thumbprint " + thumbprint + " is now trusted");
return this.trustCertificate(certificate, () => callback(null, node_opcua_status_code_1.StatusCodes.Good));
}
else {
errorLog("automaticallyAcceptUnknownCertificate = false");
errorLog("certificate with thumbprint " + thumbprint + " is now rejected");
debugLog("automaticallyAcceptUnknownCertificate = false");
debugLog("certificate with thumbprint " + thumbprint + " is now rejected");
return this.rejectCertificate(certificate, () => callback(null, node_opcua_status_code_1.StatusCodes.BadCertificateUntrusted));

@@ -93,5 +93,3 @@ }

// tslint:disable-next-line:no-console
console.log(chalk.red(" Sender certificate is invalid : certificate is not active yet !") +
" not before date =" +
cert.notBefore);
console.log(chalk.red(" Sender certificate is invalid : certificate is not active yet !") + " not before date =" + cert.notBefore);
return node_opcua_status_code_1.StatusCodes.BadCertificateTimeInvalid;

@@ -102,5 +100,3 @@ }

// tslint:disable-next-line:no-console
console.log(chalk.red(" Sender certificate is invalid : certificate has expired !") +
" not after date =" +
cert.notAfter);
console.log(chalk.red(" Sender certificate is invalid : certificate has expired !") + " not after date =" + cert.notAfter);
return node_opcua_status_code_1.StatusCodes.BadCertificateTimeInvalid;

@@ -107,0 +103,0 @@ }

18

package.json
{
"name": "node-opcua-certificate-manager",
"version": "2.19.0",
"version": "2.20.0",
"description": "pure nodejs OPCUA SDK - module -client",

@@ -24,10 +24,10 @@ "scripts": {

"node-opcua-assert": "2.16.0",
"node-opcua-basic-types": "2.19.0",
"node-opcua-basic-types": "2.20.0",
"node-opcua-buffer-utils": "2.17.0",
"node-opcua-constants": "2.16.0",
"node-opcua-crypto": "^1.3.8",
"node-opcua-debug": "2.17.0",
"node-opcua-pki": "^2.1.7",
"node-opcua-crypto": "^1.4.0",
"node-opcua-debug": "2.20.0",
"node-opcua-pki": "^2.2.1",
"node-opcua-status-code": "2.17.0",
"node-opcua-utils": "2.19.0",
"node-opcua-utils": "2.20.0",
"once": "^1.4.0",

@@ -39,5 +39,5 @@ "thenify": "^3.3.1"

"dequeue": "^1.0.5",
"node-opcua-leak-detector": "2.17.0",
"node-opcua-leak-detector": "2.20.0",
"should": "^13.2.3",
"sinon": "^9.1.0"
"sinon": "^9.2.0"
},

@@ -64,3 +64,3 @@ "eslintConfig": {

"homepage": "http://node-opcua.github.io/",
"gitHead": "0cff4bc11146a30651d1c1ab96879b2ace5486d1"
"gitHead": "9bccf4ce0486ec766445e71f9c7e906b329fd423"
}

@@ -48,7 +48,3 @@ /**

type ReadFileFunc = (
filename: string,
encoding: string,
callback: (err: Error | null, content?: Buffer) => void
) => void;
type ReadFileFunc = (filename: string, encoding: string, callback: (err: Error | null, content?: Buffer) => void) => void;

@@ -84,3 +80,3 @@ export interface OPCUACertificateManagerOptions {

keySize: 2048,
location,
location
};

@@ -101,15 +97,13 @@ super(_options);

// console.log("StatusCode = ", statusCode.toString());
debugLog("checkCertificate => StatusCode = ", statusCode.toString());
if (statusCode === StatusCodes.BadCertificateUntrusted) {
const thumbprint = makeSHA1Thumbprint(certificate).toString("hex");
if (this.automaticallyAcceptUnknownCertificate) {
errorLog("automaticallyAcceptUnknownCertificate = true");
errorLog("certificate with thumbprint " + thumbprint + " is now trusted");
debugLog("automaticallyAcceptUnknownCertificate = true");
debugLog("certificate with thumbprint " + thumbprint + " is now trusted");
return this.trustCertificate(certificate, () => callback!(null, StatusCodes.Good));
} else {
errorLog("automaticallyAcceptUnknownCertificate = false");
errorLog("certificate with thumbprint " + thumbprint + " is now rejected");
return this.rejectCertificate(certificate, () =>
callback!(null, StatusCodes.BadCertificateUntrusted)
);
debugLog("automaticallyAcceptUnknownCertificate = false");
debugLog("certificate with thumbprint " + thumbprint + " is now rejected");
return this.rejectCertificate(certificate, () => callback!(null, StatusCodes.BadCertificateUntrusted));
}

@@ -139,10 +133,4 @@ }

OPCUACertificateManager.prototype.checkCertificate = thenify.withCallback(
OPCUACertificateManager.prototype.checkCertificate,
opts
);
OPCUACertificateManager.prototype.getTrustStatus = thenify.withCallback(
OPCUACertificateManager.prototype.getTrustStatus,
opts
);
OPCUACertificateManager.prototype.checkCertificate = thenify.withCallback(OPCUACertificateManager.prototype.checkCertificate, opts);
OPCUACertificateManager.prototype.getTrustStatus = thenify.withCallback(OPCUACertificateManager.prototype.getTrustStatus, opts);

@@ -167,5 +155,3 @@ // also see OPCUA 1.02 part 4 :

console.log(
chalk.red(" Sender certificate is invalid : certificate is not active yet !") +
" not before date =" +
cert.notBefore
chalk.red(" Sender certificate is invalid : certificate is not active yet !") + " not before date =" + cert.notBefore
);

@@ -177,7 +163,3 @@ return StatusCodes.BadCertificateTimeInvalid;

// tslint:disable-next-line:no-console
console.log(
chalk.red(" Sender certificate is invalid : certificate has expired !") +
" not after date =" +
cert.notAfter
);
console.log(chalk.red(" Sender certificate is invalid : certificate has expired !") + " not after date =" + cert.notAfter);
return StatusCodes.BadCertificateTimeInvalid;

@@ -184,0 +166,0 @@ }

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc