Skip to content

Commit

Permalink
Replace pem dependency (#3711) (#4500)
Browse files Browse the repository at this point in the history
# Conflicts:
#	package.json

Co-authored-by: James Sumners <james@sumners.email>
  • Loading branch information
climba03003 and jsumners committed Jan 5, 2023
1 parent 6053031 commit 6453645
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@
"ienoopen": "^1.1.0",
"JSONStream": "^1.3.5",
"license-checker": "^25.0.1",
"pem": "^1.14.4",
"proxyquire": "^2.1.3",
"pump": "^3.0.0",
"self-cert": "^2.0.0",
"send": "^0.17.1",
"serve-static": "^1.14.1",
"simple-get": "^4.0.0",
Expand Down
13 changes: 6 additions & 7 deletions test/build-certificate.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
'use strict'

const util = require('util')
const pem = require('pem')

const createCertificate = util.promisify(pem.createCertificate)
const selfCert = require('self-cert')

async function buildCertificate () {
// "global" is used in here because "t.context" is only supported by "t.beforeEach" and "t.afterEach"
// For the test case which execute this code which will be using `t.before` and it can reduce the
// number of times executing it.
if (!global.context || !global.context.cert || !global.context.key) {
const keys = await createCertificate({ days: 1, selfSigned: true })
const certs = selfCert({
expires: new Date(Date.now() + 86400000)
})
global.context = {
cert: keys.certificate,
key: keys.serviceKey
cert: certs.certificate,
key: certs.privateKey
}
}
}
Expand Down

0 comments on commit 6453645

Please sign in to comment.