@certd/acme-client 1.26.13 → 1.26.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/agents.js +3 -10
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Simple and unopinionated ACME client",
4
4
  "private": false,
5
5
  "author": "nmorsman",
6
- "version": "1.26.13",
6
+ "version": "1.26.15",
7
7
  "main": "src/index.js",
8
8
  "types": "types/index.d.ts",
9
9
  "license": "MIT",
@@ -60,5 +60,5 @@
60
60
  "bugs": {
61
61
  "url": "https://github.com/publishlab/node-acme-client/issues"
62
62
  },
63
- "gitHead": "586725a15c561436cda37de830b278907a6fc3f5"
63
+ "gitHead": "06fed944c96fc6c5d4911bb7d3f45b51948f9d4b"
64
64
  }
package/src/agents.js CHANGED
@@ -8,7 +8,7 @@ function createAgent(opts = {}) {
8
8
  let httpAgent;
9
9
  let
10
10
  httpsAgent;
11
- const httpProxy = process.env.HTTP_PROXY || process.env.http_proxy;
11
+ const httpProxy = opts.httpProxy || process.env.HTTP_PROXY || process.env.http_proxy;
12
12
  if (httpProxy) {
13
13
  log(`acme use httpProxy:${httpProxy}`);
14
14
  httpAgent = new HttpProxyAgent(httpProxy, opts);
@@ -16,7 +16,7 @@ function createAgent(opts = {}) {
16
16
  else {
17
17
  httpAgent = new nodeHttp.Agent(opts);
18
18
  }
19
- const httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy;
19
+ const httpsProxy = opts.httpsProxy || process.env.HTTPS_PROXY || process.env.https_proxy;
20
20
  if (httpsProxy) {
21
21
  log(`acme use httpsProxy:${httpsProxy}`);
22
22
  httpsAgent = new HttpsProxyAgent(httpsProxy, opts);
@@ -38,14 +38,7 @@ function getGlobalAgents() {
38
38
 
39
39
  function setGlobalProxy(opts) {
40
40
  log('acme setGlobalProxy:', opts);
41
- if (opts.httpProxy) {
42
- process.env.HTTP_PROXY = opts.httpProxy;
43
- }
44
- if (opts.httpsProxy) {
45
- process.env.HTTPS_PROXY = opts.httpsProxy;
46
- }
47
-
48
- defaultAgents = createAgent();
41
+ defaultAgents = createAgent(opts);
49
42
  }
50
43
 
51
44
  class HttpError extends Error {