Skip to content

Commit

Permalink
Add configuration to allow self-signed certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
wltsmrz committed Feb 6, 2015
1 parent 9532c4d commit 3503049
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions config-example.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"config_version": "2.0.2",
"config_version": "2.0.3",
"debug": false,
"port": 5990,
"host": "localhost",
"ssl_enabled": false,
"ssl": {
"key_path": "./certs/server.key",
"cert_path": "./certs/server.crt"
"cert_path": "./certs/server.crt",
"reject_unauthorized": true
},
"db_path": "./ripple-rest.db",
"max_transaction_fee": 1000000,
Expand Down
6 changes: 4 additions & 2 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ nconf.env([ 'NODE_ENV', 'DATABASE_URL' ]);

var configPath = nconf.get('config')
|| process.env['TEST_CONFIG']
|| path.join(process.cwd(), 'config.json')
|| path.join(__dirname, '/../config.json');
|| path.join(process.cwd(), 'config.json');

// Load config.json
try {
Expand Down Expand Up @@ -65,6 +64,9 @@ if (nconf.get('ssl')) {
if (certPath) {
sslConfig.cert_path = resolvePath(certPath);
}
if (sslConfig.reject_unauthorized === false) {
process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0;
}

nconf.set('ssl', sslConfig);
}
Expand Down

0 comments on commit 3503049

Please sign in to comment.