crypto.createCredentials is deprecated. Use tls.createSecureContext instead
This commit is contained in:
parent
526e19b23e
commit
e0909ad0ca
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue