crypto.createCredentials is deprecated. Use tls.createSecureContext instead

This commit is contained in:
AJ ONeal 2016-06-02 10:35:30 -06:00
parent 526e19b23e
commit e0909ad0ca
1 changed files with 2 additions and 1 deletions

View File

@ -5,6 +5,7 @@
'use strict';
var crypto = require("crypto");
var tls = require("tls");
var forge = require("node-forge");
var util = require("./acme-util.js");
@ -359,7 +360,7 @@ module.exports = {
var privateKey = importPrivateKey(keyPair.privateKey);
var derCert = bufferToBytes(util.b64dec(cert));
var realCert = forge.pki.certificateFromAsn1(forge.asn1.fromDer(derCert));
return crypto.createCredentials({
return tls.createSecureContext({
key: forge.pki.privateKeyToPem(privateKey),
cert: forge.pki.certificateToPem(realCert)
}).context;