<br><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt;&gt;&gt;&gt; ss.ssl_ctx = M2Crypto.SSL.Context(&#39;tlsv1&#39;)<br>&gt;&gt;&gt;&gt; 
ss.ssl_ctx.set_cipher_list(&#39;ADH-AES128-SHA&#39;)<br>&gt;&gt;&gt;&gt; ss.ssl_ctx.set_tmp_dh(&#39;dhparam.pem&#39;)<br>&gt;&gt;&gt;&gt; ss.ssl_ctx.set_tmp_dh_callback()<br>&gt;&gt;&gt;&gt; ss.ssl_ctx.set_info_callback()
<br><br>set_info_callback can cause problems in some cases, like multithreaded<br>programs. I don&#39;t think it is a problem here, though.<br><br>As an SSL server I would also have expected it to load a server<br>certificate into the context.
</blockquote><div><br>I am using anonymous Diffie Hellman (the default is to turn off this cipher), which only requires the DH parameter file (dhparam.pem), so a certificate is not necessary at all here. The set_info_callback() was just so I can verify  the handshaking between the server and client. I can remove it and I still have the same issue.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt;&gt;&gt;&gt; ss.create_socket(ss.ssl_ctx)<br>&gt;&gt;&gt;&gt; ss.set_reuse_addr
()<br>&gt;&gt;&gt;&gt; ss.socket.setblocking(0)<br>&gt;&gt;&gt;&gt; ss.bind((&#39;<a href="http://server.home.com">server.home.com</a> &#39;, 8888))<br>&gt;&gt;&gt;&gt; ss.listen (5)<br>&gt;&gt;&gt;&gt; sa = ss.socket.accept
()<br><br>It seems like a lot of work when SSL.Connection has an accept() method.</blockquote><div><br>I still get the same result either way...<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt; #--------- client -------------------------------<br>&gt;&gt;&gt;&gt; import M2Crypto<br>&gt;&gt;&gt;&gt; import socket<br>&gt;&gt;&gt;&gt; sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)<br>&gt;&gt;&gt;&gt; ctx = 
M2Crypto.SSL.Context(&#39;tlsv1&#39;)<br>&gt;&gt;&gt;&gt; ctx.set_cipher_list(&#39;ADH-AES128-SHA&#39;)<br>&gt;&gt;&gt;&gt; ctx.set_tmp_dh(&#39;dhparam.pem&#39;)<br>&gt;&gt;&gt;&gt; ctx.set_tmp_dh_callback()<br>&gt;&gt;&gt;&gt; 
ctx.set_info_callback ()<br>&gt;&gt;&gt;&gt; s = M2Crypto.SSL.Connection(ctx, sock)<br><br>Again, I wonder why you create socket separately when<br>SSL.Connection.__init__ can do it for you.</blockquote><div><br>Except in this case, the peer certificate is verified by default and I have no interest in verifying the  peer certificate - since there isn&#39;t one.&nbsp; So I do all of the initializing instead of using all of the defaults.
<br></div></div><br>What I mean by client connection, I meant the client socket connecting (with a regular socket - the &quot;s.socket.connect()&quot;). The client doesn&#39;t truly&nbsp; connect to the server until after the accept is executed and when it does, it uses SSL. It is very strange.
<br><br>I initially ran this in linux and today tried it in Windows with a different result - no need to execute s.connect_ssl() twice! And instead of returning a result of 0 it actually returns 1. I&#39;m not totally sure what the difference is between the two. Same exact code, just a different environment (and build process - that&#39;s probably a hint).... If I figure it out, I&#39;ll let you know.
<br><br>