Skip to content

Commit 48e159f

Browse files
committed
crypto: throw a helpful error message for "tls" and "crypto"
When node is compiled with the --without-ssl flag.
1 parent 567c72b commit 48e159f

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

lib/crypto.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ try {
3131
var pseudoRandomBytes = binding.pseudoRandomBytes;
3232
var getCiphers = binding.getCiphers;
3333
var getHashes = binding.getHashes;
34-
var crypto = true;
3534
} catch (e) {
36-
37-
var crypto = false;
35+
throw new Error('node.js not compiled with openssl crypto support.');
3836
}
3937

4038
var stream = require('stream');
@@ -62,10 +60,6 @@ function Credentials(secureProtocol, flags, context) {
6260
return new Credentials(secureProtocol, flags, context);
6361
}
6462

65-
if (!crypto) {
66-
throw new Error('node.js not compiled with openssl crypto support.');
67-
}
68-
6963
if (context) {
7064
this.context = context;
7165
} else {

0 commit comments

Comments
 (0)