MCPcopy
hub / github.com/fastify/fastify / buildCertificate

Function buildCertificate

test/build-certificate.js:94–107  ·  test/build-certificate.js::buildCertificate
()

Source from the content-addressed store, hash-verified

92}
93
94function buildCertificate () {
95 class="cm">// class="st">"global" is used in here because class="st">"t.context" is only supported by class="st">"t.beforeEach" and class="st">"t.afterEach"
96 class="cm">// For the test case which execute this code which will be using `t.before` and it can reduce the
97 class="cm">// number of times executing it.
98 if (!global.context || !global.context.cert || !global.context.key) {
99 const certs = selfCert({
100 expires: new Date(Date.now() + 86400000)
101 })
102 global.context = {
103 cert: certs.certificate,
104 key: certs.privateKey
105 }
106 }
107}
108
109module.exports = { buildCertificate }

Callers 2

setupFunction · 0.85

Calls 1

selfCertFunction · 0.85

Tested by 1

setupFunction · 0.68