| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,13 +2,12 @@ | |||
| 2 | 2 | 'use strict'; | |
| 3 | 3 | ||
| 4 | 4 | const common = require('../common'); | |
| 5 | + const fixtures = require('../common/fixtures'); | ||
| 5 | 6 | ||
| 6 | 7 | if (!common.hasCrypto) | |
| 7 | 8 | common.skip('missing crypto'); | |
| 8 | 9 | ||
| 9 | 10 | const { strictEqual } = require('assert'); | |
| 10 | - const { join } = require('path'); | ||
| 11 | - const { readFileSync } = require('fs'); | ||
| 12 | 11 | const { createSecureContext } = require('tls'); | |
| 13 | 12 | const { createSecureServer, connect } = require('http2'); | |
| 14 | 13 | const { get } = require('https'); | |
@@ -17,13 +16,9 @@ const { connect: tls } = require('tls'); | |||
| 17 | 16 | ||
| 18 | 17 | const countdown = (count, done) => () => --count === 0 && done(); | |
| 19 | 18 | ||
| 20 | - function loadKey(keyname) { | ||
| 21 | - return readFileSync(join(common.fixturesDir, 'keys', keyname)); | ||
| 22 | - } | ||
| 23 | - | ||
| 24 | - const key = loadKey('agent8-key.pem'); | ||
| 25 | - const cert = loadKey('agent8-cert.pem'); | ||
| 26 | - const ca = loadKey('fake-startcom-root-cert.pem'); | ||
| 19 | + const key = fixtures.readKey('agent8-key.pem'); | ||
| 20 | + const cert = fixtures.readKey('agent8-cert.pem'); | ||
| 21 | + const ca = fixtures.readKey('fake-startcom-root-cert.pem'); | ||
| 27 | 22 | ||
| 28 | 23 | const clientOptions = { secureContext: createSecureContext({ ca }) }; | |
| 29 | 24 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments