From e0909ad0ca6fd73bcbd9b0aa678ca1ff0666ed77 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 2 Jun 2016 10:35:30 -0600 Subject: [PATCH] crypto.createCredentials is deprecated. Use tls.createSecureContext instead --- lib/letsencrypt-forge.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/letsencrypt-forge.js b/lib/letsencrypt-forge.js index 2e9c768..122867e 100644 --- a/lib/letsencrypt-forge.js +++ b/lib/letsencrypt-forge.js @@ -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;