Browse Source

Lazy load crypto

The whole program is being slowed down by the large CA string in crypto.
Why?
v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
d044e2de07
  1. 2
      lib/net.js

2
lib/net.js

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

Loading…
Cancel
Save