From: Brian Candler Date: 2010-08-09T18:01:25+09:00 Subject: Re: Looking for good Ruby OpenSSL TLS docs Aaron D. Gifford wrote: > I've got a custom TCP protocol that currently runs plaintext/cleartext > to which I want to add something akin to SMTP's STARTTLS. The scripts > use Ruby's TCPSockets. The protocol will for the most part remain > unencrypted, but when client or server requests that TLS begin, I need > to take the existing TCPSocket and initiate TLS over it. I wrote ruby-ldapserver some years ago, and I wrote code which does exactly that. Shouldn't be too hard to extract it. IIRC, an OpenSSL socket duck-types a normal socket in most ways, so you can just wrap the socket in an OpenSSL object. I would imagine you couldn't #select on it though, but would have to #select on the underlying socket instead. (I was using threads, so #select compatibility wasn't a requirement) HTH, Brian. -- Posted via http://www.ruby-forum.com/.