Skip to content

Instantly share code, notes, and snippets.

@shigeki
Created August 11, 2015 02:19
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 shigeki/d880ae0b4eef3cfd1acc to your computer and use it in GitHub Desktop.
Save shigeki/d880ae0b4eef3cfd1acc to your computer and use it in GitHub Desktop.
Sending Simplest Client Hello
var net = require('net');
var crypto = require('crypto');
var recordheader = '160301002D';
var random = crypto.randomBytes(32).toString('hex');
var handshake = '010000290303' + random + '000002009C0100';
var clienthello = new Buffer(recordheader + handshake, 'hex');
var client = net.connect({host: 'tls.koulayer.com', port: 443}, function() {
client.write(clienthello);
});
client.on('data', function(c) {
// Receive ServerHello
console.log(c);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment