It seems my main problem was that there's no SSLSocket#recv, and I was treating SSLSocket#read as if it were recv, which
is not the case. SSLSocket#readpartial is what I was looking for, it just took a really long time to find due to lack of documentation.
After figuring out readpartial, the rest wasn't hard to implement. I wrote a simple TLS-enabled echo server here: http://www.ericw.org/ruby/echo/. There's no comments or anything, I just used to to figure out what I was doing wrong. It acts as a normal echo server until you send "+STARTTLS," in which case it replies "+STARTTLS" and expects a TLS handshake to begin.
On 2/9/06, Eric Will <[EMAIL PROTECTED]> wrote:
I've figured out easily enough how to do client-to-server TLS. Unfortunately, I'm writing a server.
I can't find any examples of using Ruby's OpenSSL library from a server point of view.
I know how to create the socket, I know how to make an OpenSSL::X509::Certificate,
but I don't know how to use them together to enable clients to connect.
I just don't have any experience with OpenSSL, and I can't find any examples.
Any help would be appreciated.
--
Eric Will -- http://www.ericw.org/
xmpp:[EMAIL PROTECTED]
mailto: [EMAIL PROTECTED]
--
Eric Will -- http://www.ericw.org/
xmpp:[EMAIL PROTECTED]
mailto: [EMAIL PROTECTED]
