Skip to content

Commit d044e2d

Browse files
committed
Lazy load crypto
The whole program is being slowed down by the large CA string in crypto. Why?
1 parent afce4c3 commit d044e2d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/net.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
var sys = require("sys");
22
var fs = require("fs");
33
var events = require("events");
4-
var crypto= require("crypto");
54
var dns = require('dns');
65

76
var kMinPoolSpace = 128;
@@ -422,6 +421,7 @@ Stream.prototype.setSecure = function(credentials) {
422421
if (!have_crypto) {
423422
throw new Error('node.js not compiled with openssl crypto support.');
424423
}
424+
var crypto= require("crypto");
425425
this.secure = true;
426426
this.secureEstablished = false;
427427
// If no credentials given, create a new one for just this Stream

0 commit comments

Comments
 (0)