simple-xmpp / node-simple-xmpp

Simple High Level NodeJS XMPP Client
302 stars 90 forks source link

Trace: crypto.createCredentials is deprecated. Use tls.createSecureContext instead. #66

Open zacharyabresch opened 8 years ago

zacharyabresch commented 8 years ago

I was trying to setup a connection to my company's XMPP server and received this error message. From what I can tell, I've set things up properly so I'm not sure how to resolve this error.

System Details

I had to hide the actual credentials and server since this is a private server.

// Generated by CoffeeScript 1.10.0
(function() {
  var xmpp;

  xmpp = require('simple-xmpp');

  xmpp.on('online', function(data) {
    console.log("Connected with JID: " + data.jid.user);
    return console.log("Yes, I'm connected!");
  });

  xmpp.on('error', function(err) {
    return console.error(err);
  });

  xmpp.connect({
    jid: "[My JID]",
    password: '[My Password]',
    host: '[My Host]',
    port: 5222
  });

}).call(this);

I ran this file with node --trace-deprecation lib/app/javascript/xmppClient.js and got the following output:

Trace: crypto.createCredentials is deprecated. Use tls.createSecureContext instead.
    at Object.exports._printDeprecationMessage (internal/util.js:27:13)
    at Object.deprecated [as createCredentials] (internal/util.js:51:22)
    at connect (/Users/zabresch/Documents/8x8/electron/sso/node_modules/tls-connect/starttls.js:231:50)
    at Connection.setSecure (/Users/zabresch/Documents/8x8/electron/sso/node_modules/node-xmpp-core/lib/Connection.js:321:21)
    at Connection.onStanza (/Users/zabresch/Documents/8x8/electron/sso/node_modules/node-xmpp-core/lib/Connection.js:368:14)
    at StreamParser.<anonymous> (/Users/zabresch/Documents/8x8/electron/sso/node_modules/node-xmpp-core/lib/Connection.js:226:14)
    at emitOne (events.js:77:13)
    at StreamParser.emit (events.js:169:7)
    at SaxLtx.<anonymous> (/Users/zabresch/Documents/8x8/electron/sso/node_modules/node-xmpp-core/lib/StreamParser.js:59:22)
    at emitOne (events.js:77:13)
XMPP authentication failure

Has anyone else had this issue? Does anyone have any suggestions on how to resolve it? From the looks of it, the error might be from node-xmpp-core but I saw no issues posted on that repository. Any help would be greatly appreciated! Thanks!

zacharyabresch commented 8 years ago

Found an issue on node-xmpp-core but no responses have been made.

Also, I'm thinking that it's my XMPP authentication that's actually failing since this is just a warning. Working on it.