Allow s3 backend to accept self-signed certs

Fixes #316
This commit is contained in:
Girish Ramakrishnan
2017-10-05 10:01:09 -07:00
parent ba5645a20e
commit df6e6cb071
4 changed files with 20 additions and 1 deletions
+7 -1
View File
@@ -22,11 +22,12 @@ var assert = require('assert'),
async = require('async'),
AWS = require('aws-sdk'),
BackupsError = require('../backups.js').BackupsError,
chunk = require('lodash.chunk'),
config = require('../config.js'),
debug = require('debug')('box:storage/s3'),
EventEmitter = require('events'),
fs = require('fs'),
chunk = require('lodash.chunk'),
https = require('https'),
mkdirp = require('mkdirp'),
PassThrough = require('stream').PassThrough,
path = require('path'),
@@ -98,6 +99,11 @@ function getBackupCredentials(apiConfig, callback) {
if (apiConfig.endpoint) credentials.endpoint = apiConfig.endpoint;
if (apiConfig.acceptSelfSignedCerts === true) {
credentials.httpOptions = {
agent: new https.Agent({ rejectUnauthorized: false })
};
}
callback(null, credentials);
}