Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cli/connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function _createConnectorObject(cliData) {
name: cliData.name,
domain: cliData.domain,
publicIp: cliData.publicIp,
certDir: cliData.certDir,
cert: cliData.cert,
isSelfSignedCert: AppHelper.validateBooleanCliOptions(cliData.selfSignedEnable, cliData.selfSignedDisable),
devMode: AppHelper.validateBooleanCliOptions(cliData.devModeOn, cliData.devModeOff)
}
Expand Down
4 changes: 2 additions & 2 deletions src/schemas/connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const connectorCreate = {
"name": {"type": "string", "minLength": 1},
"domain": {"type": "string", "minLength": 4},
"publicIp": {"type": "string", "minLength": 7},
"certDir": {"type": "string"},
"cert": {"type": "string"},
"isSelfSignedCert": {"type": "boolean"},
"devMode": {"type": "boolean"}
},
Expand All @@ -33,7 +33,7 @@ const connectorUpdate = {
"name": {"type": "string", "minLength": 1},
"domain": {"type": "string", "minLength": 4},
"publicIp": {"type": "string", "minLength": 7},
"certDir": {"type": "string"},
"cert": {"type": "string"},
"isSelfSignedCert": {"type": "boolean"},
"devMode": {"type": "boolean"}
},
Expand Down
3 changes: 2 additions & 1 deletion src/services/connector-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const logger = require('../logger')
const querystring = require('querystring')
const Op = require('sequelize').Op;
const Sequelize = require('sequelize');
const fs = require('fs');

async function _createConnector(connectorData, transaction) {
await Validator.validate(connectorData, Validator.schemas.connectorCreate)
Expand Down Expand Up @@ -121,7 +122,7 @@ async function _makeRequest(connector, options, data) {
})

if (connector.cert && connector.isSelfSignedCert === true) {
let ca = '-----BEGIN CERTIFICATE-----\n' + connector.cert + '\n' + '-----END CERTIFICATE-----';
const ca = fs.readFileSync(connector.cert);
options.ca = new Buffer(ca);
}

Expand Down