Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add passphrase support #437

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -59,6 +59,8 @@ This will install `http-server` globally so that it may be run from the command

`-K` or `--key` Path to ssl key file (default: key.pem).

`-P` or `--passphrase` Pass phrase to decrypt the key (optional).
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to conflict with the option -P / --proxy


`-r` or `--robots` Provide a /robots.txt (whose content defaults to 'User-agent: *\nDisallow: /')

`-h` or `--help` Print this list and exit.
Expand Down
4 changes: 4 additions & 0 deletions bin/http-server
Expand Up @@ -37,6 +37,7 @@ if (argv.h || argv.help) {
' -S --ssl Enable https.',
' -C --cert Path to ssl cert file (default: cert.pem).',
' -K --key Path to ssl key file (default: key.pem).',
' -P --passphrase Pass phrase to decrypt the key (optional)',
'',
' -r --robots Respond to /robots.txt [User-agent: *\\nDisallow: /]',
' --no-dotfiles Do not show dotfiles',
Expand Down Expand Up @@ -118,6 +119,9 @@ function listen(port) {
cert: argv.C || argv.cert || 'cert.pem',
key: argv.K || argv.key || 'key.pem'
};
if (argv.P || argv.passphrase) {
options.https['passphrase'] = argv.P || argv.passphrase;
}
}

var server = httpServer.createServer(options);
Expand Down