How to use the tls.TLSSocket 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 SuperNETorg / Agama / routes / electrumjs / electrumjs.core.js View on Github external
const getSocket = function(protocol, options) {
  switch (protocol) {
  case 'tcp':
    return new net.Socket();
  case 'tls':
    // todo
  case 'ssl':
    return new tls.TLSSocket(options);
  }

  throw new Error('unknown protocol');
}
github trs / ftp-srv / src / connector / active.js View on Github external
this.dataSocket.connect({host, port, family}, () => {
        this.dataSocket.pause();

        if (this.connection.secure) {
          const secureContext = tls.createSecureContext(this.server.options.tls);
          const secureSocket = new tls.TLSSocket(this.dataSocket, {
            isServer: true,
            secureContext
          });
          this.dataSocket = secureSocket;
        }
        this.dataSocket.connected = true;
      });
    });
github graalvm / graaljs / graal-nodejs / benchmark / tls / secure-pair.js View on Github external
function secureTLSSocket(conn, client) {
    const serverSocket = new tls.TLSSocket(conn, options);
    serverSocket.on('error', (e) => {
      throw new Error(`Socket error: ${e}`);
    });
    serverSocket.pipe(client);
  }

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