Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

HTTPS Test Server

View ssltest.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/usr/bin/env node
 
const fs = require("fs"),
https = require("https");
 
var opts = {
key: fs.readFileSync("myprivatekey.pem", 'utf8'),
cert: fs.readFileSync("mypublickey.pem", 'utf8'),
ca: [fs.readFileSync("ca-pub.pem", 'utf8')],
requestCert: true,
rejectUnauthorized: true
};
 
var handler = function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
};
 
var server = https.createServer(opts, handler);
server.listen(443);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.