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

elastic-apm-http-client

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elastic-apm-http-client - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

6

index.js

@@ -27,3 +27,4 @@ 'use strict'

transport: url.protocol === 'https:' ? require('https') : http,
path: '/v1/'
path: '/v1/',
rejectUnauthorized: opts.rejectUnauthorized !== false
}

@@ -52,3 +53,4 @@ }

path: self._api.path + endpoint,
headers: headers
headers: headers,
rejectUnauthorized: self._api.rejectUnauthorized
}

@@ -55,0 +57,0 @@

{
"name": "elastic-apm-http-client",
"version": "4.0.0",
"version": "4.1.0",
"description": "A low-level HTTP client for communicating with the Elastic APM intake API",

@@ -18,3 +18,5 @@ "main": "index.js",

"devDependencies": {
"https-pem": "^1.0.4",
"nock": "^9.0.13",
"semver": "^5.4.1",
"standard": "^10.0.2",

@@ -39,5 +41,5 @@ "tape": "^4.7.0"

"coordinates": [
55.681032,
12.564482
55.777585,
12.5893063
]
}

@@ -42,8 +42,11 @@ # elastic-apm-http-client

The module exposes an initialize function which takes a single options
hash as the 1st argument. All properties are required:
hash as the 1st argument:
- `serverUrl` - The APM Server URL (default: `http://localhost:8200`)
- `userAgent` - The HTTP user agent that your module should identify it
self with
- `secretToken` - (optional) The Elastic APM intake API secret token
- `serverUrl` - (optional) The APM Server URL (default:
`http://localhost:8200`)
- `rejectUnauthorized` - (optional) Set to `false` if the client
shouldn't verify the APM Server TLS certificates (default: `true`)

@@ -50,0 +53,0 @@ The init function will return a low level HTTP client primed for

@@ -5,4 +5,7 @@ 'use strict'

var http = require('http')
var https = require('https')
var test = require('tape')
var nock = require('nock')
var pem = require('https-pem')
var semver = require('semver')
var Client = require('./')

@@ -135,3 +138,53 @@

})
t.test('reject unauthorized TLS by default', function (t) {
var server = https.createServer(pem, function (req, res) {
res.end('secret')
})
server.listen(function () {
var opts = {
userAgent: 'test',
serverUrl: 'https://localhost:' + server.address().port
}
var client = Client(opts)
client.request('endpoint', body, function (err, res, body) {
if (semver.gte(process.version, '0.12.0')) {
t.equal(err.message, 'self signed certificate')
t.equal(err.code, 'DEPTH_ZERO_SELF_SIGNED_CERT')
} else {
// Node.js v0.10 had the code as the message (and no code)
t.equal(err.message, 'DEPTH_ZERO_SELF_SIGNED_CERT')
}
server.close()
t.end()
})
})
})
t.test('allow unauthorized TLS by if asked', function (t) {
var server = https.createServer(pem, function (req, res) {
res.end('secret')
})
server.listen(function () {
var opts = {
userAgent: 'test',
serverUrl: 'https://localhost:' + server.address().port,
rejectUnauthorized: false
}
var client = Client(opts)
client.request('endpoint', body, function (err, res, body) {
t.error(err)
t.equal(body, 'secret')
server.close()
t.end()
})
})
})
})
})
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