|
| 1 | +'use strict'; |
| 2 | +const common = require('../common'); |
| 3 | + |
| 4 | +if (!common.hasCrypto) { |
| 5 | +common.skip('missing crypto'); |
| 6 | +return; |
| 7 | +} |
| 8 | + |
| 9 | +common.refreshTmpDir(); |
| 10 | + |
| 11 | +const fs = require('fs'); |
| 12 | +const https = require('https'); |
| 13 | +const options = { |
| 14 | +cert: fs.readFileSync(common.fixturesDir + '/test_cert.pem'), |
| 15 | +key: fs.readFileSync(common.fixturesDir + '/test_key.pem') |
| 16 | +}; |
| 17 | + |
| 18 | +const server = https.createServer(options, common.mustCall((req, res) => { |
| 19 | +res.end('bye\n'); |
| 20 | +server.close(); |
| 21 | +})); |
| 22 | + |
| 23 | +server.listen(common.PIPE, common.mustCall(() => { |
| 24 | +https.get({ |
| 25 | +socketPath: common.PIPE, |
| 26 | +rejectUnauthorized: false |
| 27 | +}); |
| 28 | +})); |