Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

starttls

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

starttls

Upgrade a regular `net.Stream` connection to a secure `tls` connection.

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.5K
decreased by-40.66%
Maintainers
1
Weekly downloads
 
Created
Source

Start TLS

Upgrade a regular net.Stream connection to a secure tls connection. See socks5-https-client for use-case.

Based on a version by Andris Reinman, itself based on an older version by Nathan Rajlich.

Usage

The only method, startTls, returns a SecurePair and takes a Socket and an optional callback called on the secure event of the pair.

var net = require('net');
var startTls = require('starttls').startTls;
var port = 21;
var socket = net.createConnection(port);

socket.on('connect', function() {
	var securePair = startTls(socket, function() {
		securePair.cleartext.write('garbage');
	});
});

License

Portions of this code copyright (c) 2012, Andris Reinman and copyright (c) 2011, Nathan Rajlich.

Modified and redistributed under an MIT license.

Keywords

FAQs

Package last updated on 07 Mar 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc