summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2012-08-29 22:53:00 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2012-08-29 22:53:07 +0200
commit8bec26122d6de0b230f74731c1d09da267c95add (patch)
tree767427b56aa005b9633e3ae1a85abd9148e9a3e6 /lib
parente4cef1a0833e6d677298600e205a142d15639bf2 (diff)
downloadandroid-node-v8-8bec26122d6de0b230f74731c1d09da267c95add.tar.gz
android-node-v8-8bec26122d6de0b230f74731c1d09da267c95add.tar.bz2
android-node-v8-8bec26122d6de0b230f74731c1d09da267c95add.zip
tls, https: throw exception on missing key/cert
Throw an exception in the tls.Server constructor when the options object doesn't contain either a PFX or a key/certificate combo. Said change exposed a bug in simple/test-tls-junk-closes-server. Addressed. Fixes #3941.
Diffstat (limited to 'lib')
-rw-r--r--lib/tls.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/tls.js b/lib/tls.js
index 098532c9e5..a104bdf738 100644
--- a/lib/tls.js
+++ b/lib/tls.js
@@ -1058,6 +1058,10 @@ function Server(/* [options], listener */) {
// Handle option defaults:
this.setOptions(options);
+ if (!self.pfx && (!self.cert || !self.key)) {
+ throw new Error('Missing PFX or certificate + private key.');
+ }
+
var sharedCreds = crypto.createCredentials({
pfx: self.pfx,
key: self.key,