How to use the tls.createSecureContext function in tls

To help you get started, we’ve selected a few tls examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github smallstep / certificates / autocert / examples / hello-mtls / node / server.js View on Github external
function createSecureContext() {
    return tls.createSecureContext({
        ca: fs.readFileSync(config.ca),
        key: fs.readFileSync(config.key),
        cert: fs.readFileSync(config.cert),
        ciphers: config.ciphers,
    });
}
github beameio / beame-sdk / src / services / SNIServer.js View on Github external
getSecureContext(servername) {
		if (!this.hosts[servername]) {
			logger.error(`SNIServer.getSecureContext: Host ${servername} is unknown`);
			return null;
		}
		if (!this.hosts[servername].secureContext) {
			this.hosts[servername].secureContext = tls.createSecureContext(this.hosts[servername].certs);
		}
		return this.hosts[servername].secureContext;
	}
github xmppjs / xmpp.js / packages / node-xmpp-server / lib / C2S / TCP / Server.js View on Github external
TCPServer.prototype._setupTls = function () {
  if (!this.options.tls) return
  var details = this.options.tls
  details.key = details.key || fs.readFileSync(details.keyPath, 'ascii')
  details.cert = details.cert || fs.readFileSync(details.certPath, 'ascii')
  this.credentials = tls.createSecureContext(details)
}

tls

[![Build Status](https://secure.travis-ci.org/rolandpoulter/js-utils.png)](http://travis-ci.org/rolandpoulter/js-utils)

Unknown
Latest version published 12 years ago

Package Health Score

41 / 100
Full package analysis