Skip to content

Commit

Permalink
Permit tls section for https config
Browse files Browse the repository at this point in the history
When there is an untrusted CA signed cert in the chain (perhaps a
self-signed cert, for example) HTTPS requests will fail perhaps with
SELF_SIGNED_CERT_IN_CHAIN or UNABLE_TO_VERIFY_LEAF_SIGNATURE.

If you know you can trust the host `https` takes a `rejectUnauthorized`
config property that won't raise en error (like the `-k` flag for curl).
  • Loading branch information
kjgorman committed Aug 15, 2015
1 parent 06259de commit f8b06c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion lib/schemas/minigun_test_script.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
"mode": {
"type": "string",
"enum": [ "poisson", "uniform" ]
}
},
"tls": {
"type": "object"
},
},
"required": ["target", "phases"]
},
Expand Down
6 changes: 4 additions & 2 deletions lib/worker_http.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@ function createRequest(requestSpec, config, ee) {
var method = _.keys(requestSpec)[0].toUpperCase();
var params = requestSpec[method.toLowerCase()];
var uri = maybePrependBase(template(params.url, context), config);
var requestParams = {
var tls = config.tls || {};

var requestParams = _.extend(tls, {
uri: uri,
method: method,
headers: {
},
timeout: 10 * 1000
};
});

if (params.json) {
requestParams.json = template(params.json, context);
Expand Down

0 comments on commit f8b06c8

Please sign in to comment.