Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Better security options handling

Signed-off-by: Jan Keromnes <janx@linux.com>
  • Loading branch information...
commit b2851f69501bd6503062b14efa5e272cffffbf55 1 parent 76d86b4
@jankeromnes authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 lib/camp.js
View
7 lib/camp.js
@@ -406,7 +406,7 @@ function startServer (settings) {
var server;
// Are we running https?
- if (settings.security.key && settings.security.cert) { // Yep
+ if (settings.secure) { // Yep
server = new SecureCamp ({
key: fs.readFileSync(settings.security.key),
cert: fs.readFileSync(settings.security.cert),
@@ -448,11 +448,10 @@ function start (options) {
if (options.secure) {
settings.security.key = options.key || 'https.key';
settings.security.cert = options.cert || 'https.crt';
- settings.security.ca = options.ca || [ 'https.ca' ];
+ settings.security.ca = options.ca || [];
}
- settings.port = options.port ||
- (settings.security.key && settings.security.cert ? 443 : 80);
+ settings.port = settings.port || (settings.secure ? 443 : 80);
return startServer(settings);
};
Please sign in to comment.
Something went wrong with that request. Please try again.