After about a week or so of trying to get this sorted, I finally have.<br>
<br>
It seems my main problem was that there's no SSLSocket#recv, and I was treating SSLSocket#read as if it were recv, which<br>
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.<br>
<br>
After figuring out readpartial, the rest wasn't hard to implement. I
wrote a simple TLS-enabled echo server here:
<a href="http://www.ericw.org/ruby/echo/">http://www.ericw.org/ruby/echo/</a>. 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.<br><br><div><span class="gmail_quote">On 2/9/06, <b class="gmail_sendername">Eric Will</b> <<a href="mailto:rakaur@malkier.net">rakaur@malkier.net</a>> wrote:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I've figured out easily enough how to do client-to-server TLS. Unfortunately, I'm writing a server.
<br>
<br>
I can't find any examples of using Ruby's OpenSSL library from a server point of view.<br>
I know how to create the socket, I know how to make an OpenSSL::X509::Certificate,<br>
but I don't know how to use them together to enable clients to connect.<br>
<br>
I just don't have any experience with OpenSSL, and I can't find any examples.<br>
Any help would be appreciated.<br clear="all"><span class="sg"><br>-- <br>Eric Will -- <a href="http://www.ericw.org/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.ericw.org/</a><br><a href="mailto:xmpp:rakaur@malkier.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
xmpp:rakaur@malkier.net</a><br>mailto:<a href="mailto:rakaur@malkier.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
rakaur@malkier.net</a>
</span></blockquote></div><br><br clear="all"><br>-- <br>Eric Will -- <a href="http://www.ericw.org/">http://www.ericw.org/</a><br><a href="mailto:xmpp:rakaur@malkier.net">xmpp:rakaur@malkier.net</a><br>mailto:<a href="mailto:rakaur@malkier.net">
rakaur@malkier.net</a>