128a03450a
* fix: tls check shouldnt rely on an external service * fix linting in the tls script'
18 lines
446 B
JavaScript
18 lines
446 B
JavaScript
var fs = require('fs')
|
|
var https = require('https')
|
|
var path = require('path')
|
|
|
|
var server = https.createServer({
|
|
key: fs.readFileSync(path.resolve(__dirname, 'tls.key.pem')),
|
|
cert: fs.readFileSync(path.resolve(__dirname, 'tls.cert.pem'))
|
|
}, (req, res) => {
|
|
res.end(JSON.stringify({ protocol: req.socket.getProtocol() }))
|
|
|
|
setTimeout(() => {
|
|
server.close()
|
|
}, 0)
|
|
})
|
|
|
|
server.listen(0, () => {
|
|
console.log(server.address().port)
|
|
})
|