Skip to content

Instantly share code, notes, and snippets.

@kawaz
Created June 28, 2012 04:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kawaz/3009120 to your computer and use it in GitHub Desktop.
Save kawaz/3009120 to your computer and use it in GitHub Desktop.
SNI利用サンプル
var https = require('https')
, fs = require('fs')
, defaultCredentials =
{ key: fs.readFileSync('example.com/server.key')
, cert: fs.readFileSync('example.com/server.crt')
, ca: fs.readFileSync('example.com/server.cacert.crt')
}
, jpCredentials =
{ key: fs.readFileSync('example.jp/server.key')
, cert: fs.readFileSync('example.jp/server.crt')
, ca: fs.readFileSync('example.jp/server.cacert.crt')
}
;
var server = https.createServer(defaultCredentials , cb);
server.addContext('example.jp', jpCredentials);
//server.addContext('sub.example.jp', subjpCredentials);
//server.addContext('*.example.net', wildcardnetCredentials);
server.listen(8000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment