Sha256: 5251ffc7d15825dd81a0ee508e142397917c95d0a808be6c4919ad5b3d438721

Contents?: true

Size: 811 Bytes

Versions: 26

Compression:

Stored size: 811 Bytes

Contents

var fs = require("fs")
var https = require("https")
var options = { key: fs.readFileSync("./server.key")
              , cert: fs.readFileSync("./server.crt") }

var server = https.createServer(options, function (req, res) {
  res.writeHead(200)
  res.end()
  server.close()
})
server.listen(1337)

var ca = fs.readFileSync("./ca.crt")
var agent = new https.Agent({ host: "localhost", port: 1337, ca: ca })

https.request({ host: "localhost"
              , method: "HEAD"
              , port: 1337
              , headers: { host: "testing.request.mikealrogers.com" }
              , agent: agent
              , ca: [ ca ]
              , path: "/" }, function (res) {
  if (res.client.authorized) {
    console.log("node test: OK")
  } else {
    throw new Error(res.client.authorizationError)
  }
}).end()

Version data entries

26 entries across 26 versions & 3 rubygems

Version Path
ela-4.1.6 node_modules/request/tests/ssl/ca/server.js
ela-4.1.5 node_modules/request/tests/ssl/ca/server.js
ela-4.1.4 node_modules/request/tests/ssl/ca/server.js
ela-4.1.3 node_modules/request/tests/ssl/ca/server.js
ela-4.1.2 node_modules/request/tests/ssl/ca/server.js
ela-4.1.1 node_modules/request/tests/ssl/ca/server.js
ela-4.1.0 node_modules/request/tests/ssl/ca/server.js
ela-4.0.0 node_modules/request/tests/ssl/ca/server.js
ela-3.4.3 node_modules/request/tests/ssl/ca/server.js
ela-3.4.2 node_modules/request/tests/ssl/ca/server.js
ela-3.4.0 node_modules/request/tests/ssl/ca/server.js
ela-3.3.1 node_modules/request/tests/ssl/ca/server.js
ela-3.3.0 node_modules/request/tests/ssl/ca/server.js
ela-3.2.0 node_modules/request/tests/ssl/ca/server.js
ela-3.1.1 node_modules/request/tests/ssl/ca/server.js
ela-3.1.0 node_modules/request/tests/ssl/ca/server.js
ela-3.0.0 node_modules/request/tests/ssl/ca/server.js
ela-2.0.0 node_modules/request/tests/ssl/ca/server.js
ela-1.1.0 node_modules/request/tests/ssl/ca/server.js
vulcan-0.8.2 server/node_modules/cradle/node_modules/request/tests/ssl/ca/server.js