Skip to content

Instantly share code, notes, and snippets.

@nwhatt
Created August 9, 2017 15:25
Show Gist options
  • Save nwhatt/deb6d99b012a6ec9fe4a7b831436219b to your computer and use it in GitHub Desktop.
Save nwhatt/deb6d99b012a6ec9fe4a7b831436219b to your computer and use it in GitHub Desktop.
Client Certificate API request
var request = require('request');
var fs = require('fs');
var key = fs.readFileSync(__dirname + '/ssl/server.key');
var cert = fs.readFileSync(__dirname + '/ssl/server.cert');
request.post({
uri: 'https://api.redoxengine.com/auth/authenticate',
cert: cert,
key: key,
body: {
apiKey: '',
secret: '',
},
headers: {
'Content-Type': 'application/json'
},
json: true
}, function (err, response, body) {
console.log('statuscode\n', response.statusCode, 'body\n', body);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment