Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix crypto credentials all over again

  • Loading branch information...
commit ed120fc704abb284937b80a7bf32e7c888414376 1 parent 30c3403
@astro astro authored
Showing with 5 additions and 5 deletions.
  1. +1 −3 lib/starttls.js
  2. +4 −2 lib/xmpp/c2s.js
View
4 lib/starttls.js
@@ -17,9 +17,7 @@ var tls = require('tls');
module.exports = function starttls(socket, credentials, isServer, cb) {
- var sslcontext = crypto.createCredentials(credentials);
-
- var pair = tls.createSecurePair(sslcontext, isServer, false, !isServer);
+ var pair = tls.createSecurePair(credentials, isServer, false, !isServer);
var cleartext = pipe(pair, socket);
View
6 lib/xmpp/c2s.js
@@ -30,7 +30,9 @@ function C2SServer(options) {
// Load TLS key material
if (options.tls) {
- this.credentials = { key: fs.readFileSync(options.tls.keyPath, 'ascii'), cert: fs.readFileSync(options.tls.certPath, 'ascii')};
+ var key = fs.readFileSync(options.tls.keyPath, 'ascii');
+ var cert = fs.readFileSync(options.tls.certPath, 'ascii');
+ this.credentials = crypto.createCredentials({ key: key, cert: cert });
}
}
@@ -72,7 +74,7 @@ function C2SStream(socket, server) {
self.emit("disconnect", self);
}
});
-
+
return self;
};
util.inherits(C2SStream, Connection.Connection);
Please sign in to comment.
Something went wrong with that request. Please try again.