diff options
author | Nathan Rajlich <nathan@tootallnate.net> | 2013-07-07 19:11:07 -0700 |
---|---|---|
committer | Nathan Rajlich <nathan@tootallnate.net> | 2013-07-09 11:27:38 -0700 |
commit | 48e159faf2f9cc952474a99e6146ae2486c28115 (patch) | |
tree | 5bc69022b5c318e1c13bf482631f2cd66b06cdfb /lib/crypto.js | |
parent | 567c72b8c5f2650cc0d18b54afcfe84b692c5448 (diff) | |
download | node-new-48e159faf2f9cc952474a99e6146ae2486c28115.tar.gz |
crypto: throw a helpful error message for "tls" and "crypto"
When node is compiled with the --without-ssl flag.
Diffstat (limited to 'lib/crypto.js')
-rw-r--r-- | lib/crypto.js | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/crypto.js b/lib/crypto.js index ed8b7539e7..90e139af32 100644 --- a/lib/crypto.js +++ b/lib/crypto.js @@ -31,10 +31,8 @@ try { var pseudoRandomBytes = binding.pseudoRandomBytes; var getCiphers = binding.getCiphers; var getHashes = binding.getHashes; - var crypto = true; } catch (e) { - - var crypto = false; + throw new Error('node.js not compiled with openssl crypto support.'); } var stream = require('stream'); @@ -62,10 +60,6 @@ function Credentials(secureProtocol, flags, context) { return new Credentials(secureProtocol, flags, context); } - if (!crypto) { - throw new Error('node.js not compiled with openssl crypto support.'); - } - if (context) { this.context = context; } else { |