Socket
Socket
Sign inDemoInstall

@elastic/transport

Package Overview
Dependencies
Maintainers
67
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elastic/transport - npm Package Compare versions

Comparing version 8.7.0 to 8.7.1

.tap/processinfo/05b597cc-eb7c-4dd5-80a6-5200f04d9c8e.json

1

lib/connection/BaseConnection.d.ts

@@ -88,1 +88,2 @@ /// <reference types="node" />

export declare function getIssuerCertificate(socket: TLSSocket): DetailedPeerCertificate | null;
export declare function isCaFingerprintMatch(cert1: string | null, cert2: string | null): boolean;

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.getIssuerCertificate = exports.prepareHeaders = void 0;
exports.isCaFingerprintMatch = exports.getIssuerCertificate = exports.prepareHeaders = void 0;
const tslib_1 = require("tslib");

@@ -232,2 +232,11 @@ const util_1 = require("util");

exports.getIssuerCertificate = getIssuerCertificate;
function isCaFingerprintMatch(cert1, cert2) {
if (typeof cert1 === 'string' && typeof cert2 === 'string') {
const c1 = cert1.toLowerCase().replace(/:/g, '');
const c2 = cert2.toLowerCase().replace(/:/g, '');
return c1 === c2;
}
return cert1 === cert2;
}
exports.isCaFingerprintMatch = isCaFingerprintMatch;
//# sourceMappingURL=BaseConnection.js.map

2

lib/connection/HttpConnection.js

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

/* istanbul ignore else */
if (this[symbols_1.kCaFingerprint] !== issuerCertificate.fingerprint256) {
if (!(0, BaseConnection_1.isCaFingerprintMatch)(this[symbols_1.kCaFingerprint], issuerCertificate.fingerprint256)) {
onError(new Error('Server certificate CA fingerprint does not match the value configured in caFingerprint'));

@@ -232,0 +232,0 @@ request.once('error', () => { }); // we need to catch the request aborted error

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

/* istanbul ignore else */
if (caFingerprint !== issuerCertificate.fingerprint256) {
if (!(0, BaseConnection_1.isCaFingerprintMatch)(caFingerprint, issuerCertificate.fingerprint256)) {
socket.destroy();

@@ -83,0 +83,0 @@ return cb(new Error('Server certificate CA fingerprint does not match the value configured in caFingerprint'), null);

{
"name": "@elastic/transport",
"version": "8.7.0",
"version": "8.7.1",
"description": "Transport classes and utilities shared among Node.js Elastic client libraries",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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