{"size": 607, "ext": "js", "max_stars_repo_path": "server/server.js", "max_stars_repo_name": "baowen/mutual_auth_example", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server/server.js", "max_issues_repo_name": "baowen/mutual_auth_example", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server/server.js", "max_forks_repo_name": "baowen/mutual_auth_example", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.5909090909, "max_line_length": 62, "alphanum_fraction": 0.6457990115}
const tls = require('tls');
const fs = require('fs');
const https = require('https');

const options = {
  key: fs.readFileSync('server-key.pem'),
  cert: fs.readFileSync('server-crt.pem'),
  ca: fs.readFileSync('../ca-crt.pem'),
  requestCert: true,
  rejectUnauthorized: true
};

https.createServer(options, function (req, res) {
  console.log('server connected',
       res.socket.authorized ? 'authorized' : 'unauthorized');
    console.log(new Date()+' '+
        req.connection.remoteAddress+' '+
        req.method+' '+req.url);
    res.writeHead(200);
    res.end("hello world\n");
}).listen(8000);
