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

@wjsc/remote-config-client

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wjsc/remote-config-client - npm Package Compare versions

Comparing version 0.0.9 to 1.0.0

15

credentials.js
const assert = require('assert');
const createClientCredentials = (grpc, privateKey, caCertificate, clientCertificate) => {
if(!caCertificate && !privateKey && !clientCertificate){
if(!caCertificate){
console.warn('Client connecting without SSL/TLS Authentication');
return createInsecureClientCredentials(grpc);
}
if(!clientCertificate){
console.warn('Client connecting without Mutual SSL/TLS');
return createSslServerCredentials(grpc, caCertificate);
}
assert(caCertificate, 'SSL/TLS Authentication: CA certificate is required');
assert(privateKey, 'SSL/TLS Authentication: Client private key is required');
assert(clientCertificate, 'SSL/TLS Authentication: Client certificate is required' );
return createSslClientCredentials(grpc, caCertificate, privateKey, clientCertificate, true);
return createSslMutualCredentials(grpc, caCertificate, privateKey, clientCertificate);
}
const createSslClientCredentials = ( grpc, caCertificate, privateKey, clientCertificate ) =>
const createSslMutualCredentials = ( grpc, caCertificate, privateKey, clientCertificate ) =>
grpc.credentials.createSsl(

@@ -21,2 +25,7 @@ Buffer.from(caCertificate, 'utf8'),

const createSslServerCredentials = ( grpc, caCertificate, ) =>
grpc.credentials.createSsl(
Buffer.from(caCertificate, 'utf8')
);
const createInsecureClientCredentials = grpc => grpc.credentials.createInsecure();

@@ -23,0 +32,0 @@

2

package.json
{
"name": "@wjsc/remote-config-client",
"version": "0.0.9",
"version": "1.0.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

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