Skip to content

Instantly share code, notes, and snippets.

@waveto
waveto / TLS to smtp.gmail.com
Created February 23, 2010 22:31
node.js TLS connection to smtp.gmail.com
tcp = require("tcp");
sys = require("sys");
// Google smtp server
var client = tcp.createConnection(25, 'smtp.gmail.com');
// Thawte Premium Server CA
var caPem = '-----BEGIN CERTIFICATE-----\n'
+ 'MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkEx\n'
+ 'FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD\n'
@waveto
waveto / node.js starttls
Created February 23, 2010 22:29
Allow setSecure() to be called on an existing connection, to support STARTTLS handshaking
From 5a42382681452a6fe94c2224cd7a66047f417a96 Mon Sep 17 00:00:00 2001
From: Rhys Jones <[email protected]>
Date: Tue, 23 Feb 2010 22:27:35 +0000
Subject: [PATCH] Allow setSecure() to be called on an existing connection, to support STARTTLS handshaking
---
deps/evcom/evcom.c | 22 ++++++++++++++++++++++
deps/evcom/evcom.h | 1 +
src/node_net.cc | 3 +++
3 files changed, 26 insertions(+), 0 deletions(-)