summaryrefslogtreecommitdiff
path: root/lib/tls.js
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2016-03-08 15:31:31 -0800
committerJames M Snell <jasnell@gmail.com>2016-03-23 10:34:40 -0700
commitf429fe1b88db3463957058ec8975d3365fc3fefa (patch)
tree86942a51c941785ed4f472e7ca85e1f01d64d640 /lib/tls.js
parent0b3936b49f06743ea7aa48f4c03c99edf48afe80 (diff)
downloadandroid-node-v8-f429fe1b88db3463957058ec8975d3365fc3fefa.tar.gz
android-node-v8-f429fe1b88db3463957058ec8975d3365fc3fefa.tar.bz2
android-node-v8-f429fe1b88db3463957058ec8975d3365fc3fefa.zip
crypto: fail early when loading crypto without openssl
Fail early in require('crypto'), require('tls'), require('https'), etc when crypto is not available (rather than depending on an internal try/catch). Add documentation for detecting when crypto is not available. PR-URL: https://github.com/nodejs/node/pull/5611 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'lib/tls.js')
-rw-r--r--lib/tls.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/tls.js b/lib/tls.js
index 808f8d417a..8699207a24 100644
--- a/lib/tls.js
+++ b/lib/tls.js
@@ -1,5 +1,7 @@
'use strict';
+require('internal/util').assertCrypto(exports);
+
const net = require('net');
const url = require('url');
const binding = process.binding('crypto');