SocketBio makes a lot more sense now, and that might explain a different problem I had during my various attempts of SIGPIPE errors in the ssl writes. I'll look at the LoE of modifying _ssl, but I am not optimistic. You might hear from me again on that subject. In the meantime, I assume I am doomed to use blocking sockets of some kind to get this working?<br>
<br>-Adam<br><br><div class="gmail_quote">On Wed, Oct 24, 2012 at 6:48 AM, Kristján Valur Jónsson <span dir="ltr"><<a href="mailto:kristjan@ccpgames.com" target="_blank">kristjan@ccpgames.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">






<div link="blue" vlink="purple" lang="EN-GB">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Ah.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">The problem is that the patched _ssl module mentioned in stacklesslib is code that is proprietory to CCP
</span><span style="font-size:11.0pt;font-family:Wingdings;color:#1f497d">J</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I did this to allow one to wrap a python object, not just a socket, so that the _ssl module would call python callbacks for the actual data transfer, rather
 than attempt doing its own socket communications.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">This would allow you to put any actual transport mechanism in place.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I could make this part of the 2.x stackless distro.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">in 3.x, I think , they already use openssl, which is more low level and allows you to drive the ssl thingie yourself.  But I haven’t looked.<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US"> <a href="mailto:stackless-bounces@stackless.com" target="_blank">stackless-bounces@stackless.com</a> [mailto:<a href="mailto:stackless-bounces@stackless.com" target="_blank">stackless-bounces@stackless.com</a>]
<b>On Behalf Of </b>Adam Turk<br>
<b>Sent:</b> 23. október 2012 14:47<br>
<b>To:</b> <a href="mailto:stackless@stackless.com" target="_blank">stackless@stackless.com</a><br>
<b>Subject:</b> [Stackless] SocketBio and the mysterious sslwrap<u></u><u></u></span></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">List,<br>
<br>
2.7.2 Stackless 3.1b3 060516 (default, Oct 22 2012, 11:45:30) [GCC 4.5.2]<br>
Stacklesslib Unreleased version  (1.0.4?)<br>
SleekXMPP 1.1.10<br>
OpenSSL 0.9.8<br>
<br>
I'm working on a project that requires SleekXMPP to run under Stackless. Sleek likes to make use of SSL and TLS, and everything seems good until Sleek calls do_handshake() on the SSLSocket and a call way down the C stack returns Errno 9 Bad file descriptor.
 The problem is that SSL will return this if there's a cert trust problem, but I don't think that's the whole issue. It's possibly related to the fact that I wasn't able to use SocketBio, using a proxy object instead to get the _socket.socket inheritance that
 _ssl.sslwrap seems to require. There's a note in the comments for patch_ssl() that mentions a modifed _ssl module that can wrap any object, not just _socket.socket, but I found no other reference. Sleek without Stackless and monkeypatching works flawlessly.
 Has anyone had similar issues using Stackless with SSL? Possibly even with Sleek?<br>
<br>
-Adam<u></u><u></u></p>
</div></div></div>
</div>
</div>

<br>_______________________________________________<br>
Stackless mailing list<br>
<a href="mailto:Stackless@stackless.com">Stackless@stackless.com</a><br>
<a href="http://www.stackless.com/mailman/listinfo/stackless" target="_blank">http://www.stackless.com/mailman/listinfo/stackless</a><br></blockquote></div><br>