Skip to content

mk-pmb/ssldebug-dummycert-pmb-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ssldebug-dummycert-pmb

A dummy SSL certificate for debugging, wrapped in JSON and a node module.

ssldebug.pem —{pem2json.sed}→ ssldebug.json:

{"key":"-----BEGIN RSA PRIVATE KEY-----\n\n-----END RSA PRIVATE KEY-----",
"cert":"-----BEGIN CERTIFICATE-----\n\n-----END CERTIFICATE-----"}

The node module exports a factory function that produces copies of the object from the JSON file, with an extra property both that contains both, concatenated.

Usage

from usage.js:

var dummyCert = require('ssldebug-dummycert-pmb')(),
  block = ['-----BEGIN ', '-----\n…\n-----END ', '-----'];
equal(noData(dummyCert.key),  block.join('RSA PRIVATE KEY'));
equal(noData(dummyCert.cert), block.join('CERTIFICATE'));
equal(noData(dummyCert.both), block.join('RSA PRIVATE KEY') +
                       '\n' + block.join('CERTIFICATE'));

Known issues

  • Needs more/better tests and docs.

 

License

ISC

About

A dummy SSL certificate for debugging, wrapped in JSON and a node module.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published