hi all, i run into this problem&nbsp;&nbsp; &ldquo;<br><br><br>&rdquo;The debugged program raised the exception unhandled Error<br>&quot;[(&#39;PEM routines&#39;, &#39;PEM_read_bio&#39;, &#39;no start line&#39;), (&#39;SSL routines&#39;, &#39;SSL_CTX_use_PrivateKey_file&#39;, &#39;PEM lib&#39;)]&quot;<br>
File: /usr/lib/python2.5/site-packages/Twisted-10.0.0-py2.5-linux-i686.egg/twisted/internet/ssl.py, Line: 99&quot; <br><br><br>&nbsp;( usr/lib/python25/site-packages/Twisted-10.0.0-py2.5-linux-i686.egg/twisted/internet/ssl.py&nbsp; line 99 )<br>
<br>&nbsp;&nbsp;&nbsp; def cacheContext(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if self._context is None:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ctx = self._contextFactory(self.sslmethod)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Disallow SSLv2!&nbsp; It&#39;s insecure!&nbsp; SSLv3 has been around since<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # 1996.&nbsp; It&#39;s time to move on.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ctx.set_options(SSL.OP_NO_SSLv2)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ctx.use_certificate_file(self.certificateFileName)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ctx.use_privatekey_file(self.privateKeyFileName)&nbsp;&nbsp;&nbsp; # Line: 99 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self._context = ctx<br>
<br>here is the way i create privkey file :<br>&nbsp;&nbsp; $ openssl genrsa &gt; privkey.pem <br><br>then<br>&nbsp;&nbsp; $ openssl req -new -x509 -key privkey.pem -out cacert.pem -days 1000<br><br>i have checked the cacert.pem file it do has &#39;strt line &#39; £­£­BEGIN CERTIFICATE£­£­£­£­<br>
<br><br>&nbsp;part of my code&nbsp; :<br><br><br>class syslogOptions(usage.Options):&nbsp; <br>&nbsp;&nbsp;&nbsp; optParameters = [[&#39;cert&#39;, &#39;c&#39;, &#39;/home/ssltest/cacert.pem&#39;,&#39;SSL Server certificate&#39;],<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&#39;ip&#39;,&nbsp;&nbsp; &#39;i&#39;, None, &#39;IP Address to listen on&#39;]]<br>
&nbsp;&nbsp;&nbsp; def postOptions(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (not self.opts[&#39;cert&#39;]) or (not os.path.isfile(self.opts[&#39;cert&#39;])):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; raise usage.UsageError, &quot;%s: is not a file&quot; % self.opts[&#39;cert&#39;]<br>
. . . <br>syslogSSL = syslogFactory()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; syslogSSL.protocol = outputTCP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; ctx = ssl.DefaultOpenSSLContextFactory(config.opts[&#39;cert&#39;], config.opts[&#39;cert&#39;])&nbsp;&nbsp; <br>
&nbsp;.. .. . <br>&nbsp;reactor.listenSSL(708, syslogSSL , ctx, interface=config.opts[&#39;ip&#39;])&nbsp; <br>&nbsp;&nbsp;&nbsp; reactor.run()&nbsp;&nbsp; <br><br>any ideas ? ...<br><br><br><br><br><br><br><br><div class="gmail_quote">2010/3/25  <span dir="ltr">&lt;<a href="mailto:twisted-python-request@twistedmatrix.com">twisted-python-request@twistedmatrix.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Send Twisted-Python mailing list submissions to<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:twisted-python-request@twistedmatrix.com">twisted-python-request@twistedmatrix.com</a><br>
<br>
You can reach the person managing the list at<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:twisted-python-owner@twistedmatrix.com">twisted-python-owner@twistedmatrix.com</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of Twisted-Python digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
 &nbsp; 1. Re: Nothing Succeeds Like Success (Stories) (David)<br>
 &nbsp; 2. Logout from a perspective broker server (Ramiro Alba Queipo)<br>
 &nbsp; 3. Re: stdio.StandardIO blocks? (Glyph Lefkowitz)<br>
 &nbsp; 4. Re: Logout from a perspective broker server (Glyph Lefkowitz)<br>
 &nbsp; 5. Re: Logout from a perspective broker server (Ramiro Alba Queipo)<br>
 &nbsp; 6. NetstringReceiver (Albert Brandl)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Tue, 23 Mar 2010 10:48:41 -0600<br>
From: David &lt;<a href="mailto:dvkeeney@gmail.com">dvkeeney@gmail.com</a>&gt;<br>
Subject: Re: [Twisted-Python] Nothing Succeeds Like Success (Stories)<br>
To: Twisted general discussion &lt;<a href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a>&gt;<br>
Message-ID:<br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;<a href="mailto:6e04113a1003230948j41fd0e5bn53ceda6970b36e43@mail.gmail.com">6e04113a1003230948j41fd0e5bn53ceda6970b36e43@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
On Mon, Mar 22, 2010 at 8:39 PM, Glyph Lefkowitz<br>
&lt;<a href="mailto:glyph@twistedmatrix.com">glyph@twistedmatrix.com</a>&gt; wrote:<br>
<br>
&gt; If you&#39;re a happy Twisted user who has used Twisted to do something cool, *please* send in a blurb for the success stories page! ?This could translate into more money and more development for Twisted, thus making it even more awesome. ?This goes double if you&#39;re a sponsor: please let us know why you sponsored and how happy you were that you did :).<br>

<br>
<br>
Rdbhost<br>
<br>
Rdbhost uses Twisted for a streaming web-server. &nbsp;The streaming server<br>
allows users to stream large SQL &#39;dump&#39; files to and from the database<br>
host using a web browser.<br>
<br>
<a href="http://www.rdbhost.com" target="_blank">http://www.rdbhost.com</a><br>
<br>
--<br>
<a href="mailto:dkeeney@rdbhost.com">dkeeney@rdbhost.com</a><br>
Rdbhost -&gt; SQL databases as a webservice [<a href="http://www.rdbhost.com" target="_blank">www.rdbhost.com</a>]<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Tue, 23 Mar 2010 19:30:36 +0100<br>
From: Ramiro Alba Queipo &lt;<a href="mailto:raq@cttc.upc.edu">raq@cttc.upc.edu</a>&gt;<br>
Subject: [Twisted-Python] Logout from a perspective broker server<br>
To: Twisted general discussion &lt;<a href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a>&gt;<br>
Message-ID: &lt;1269369036.6222.11.camel@mundo&gt;<br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
Hi all,<br>
<br>
I wonder, if I client using pygtk, can logout from the server without<br>
calling reactor.stop(), as you would kill the GUI. I tried to delete the<br>
perspective got from the server but it does not work...<br>
<br>
Thanks in advance<br>
Regards<br>
<br>
--<br>
Ramiro Alba<br>
<br>
Centre Tecnol?gic de Tranfer?ncia de Calor<br>
<a href="http://www.cttc.upc.edu" target="_blank">http://www.cttc.upc.edu</a><br>
<br>
<br>
Escola T?cnica Superior d&#39;Enginyeries<br>
Industrial i Aeron?utica de Terrassa<br>
Colom 11, E-08222, Terrassa, Barcelona, Spain<br>
Tel: (+34) 93 739 86 46<br>
<br>
<br>
--<br>
Aquest missatge ha estat analitzat per MailScanner<br>
a la cerca de virus i d&#39;altres continguts perillosos,<br>
i es considera que est? net.<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Wed, 24 Mar 2010 05:22:39 -0400<br>
From: Glyph Lefkowitz &lt;<a href="mailto:glyph@twistedmatrix.com">glyph@twistedmatrix.com</a>&gt;<br>
Subject: Re: [Twisted-Python] stdio.StandardIO blocks?<br>
To: Twisted general discussion &lt;<a href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a>&gt;<br>
Message-ID: &lt;<a href="mailto:6EB44FA1-3F26-433F-A2B3-3FE4AC3A5BD0@twistedmatrix.com">6EB44FA1-3F26-433F-A2B3-3FE4AC3A5BD0@twistedmatrix.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;us-ascii&quot;<br>
<br>
<br>
On Mar 23, 2010, at 10:00 AM, Willy Lai wrote:<br>
<br>
&gt; What I want, is writing stuff in the console, without interrupting the<br>
&gt; ping mechanism.<br>
&gt; (The pings and pongs in my case should continue to be sent while typing<br>
&gt; stuff in the console)<br>
<br>
Without a *complete* program example, we can&#39;t really tell you what might be blocking. It may be a lot of things, from some very simple problems to some very complex ones. &nbsp;Please see &lt;<a href="http://sscce.org/" target="_blank">http://sscce.org/</a>&gt; for details on what types of examples would be useful.<br>

<br>
Based on your simple description, this really should work. &nbsp;If it didn&#39;t, &#39;twistd&#39; wouldn&#39;t be able to log to stdout and run a server at the same time (and it definitely can, I do that every day, at least ten times).<br>

<br>
Thanks,<br>
<br>
-glyph<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://twistedmatrix.com/pipermail/twisted-python/attachments/20100324/65c72bbb/attachment.html" target="_blank">http://twistedmatrix.com/pipermail/twisted-python/attachments/20100324/65c72bbb/attachment.html</a><br>

<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Wed, 24 Mar 2010 05:27:13 -0400<br>
From: Glyph Lefkowitz &lt;<a href="mailto:glyph@twistedmatrix.com">glyph@twistedmatrix.com</a>&gt;<br>
Subject: Re: [Twisted-Python] Logout from a perspective broker server<br>
To: Twisted general discussion &lt;<a href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a>&gt;<br>
Message-ID: &lt;<a href="mailto:44DAEAB5-A177-4367-BBE0-98475F236004@twistedmatrix.com">44DAEAB5-A177-4367-BBE0-98475F236004@twistedmatrix.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;us-ascii&quot;<br>
<br>
<br>
On Mar 23, 2010, at 2:30 PM, Ramiro Alba Queipo wrote:<br>
<br>
&gt; I wonder, if I client using pygtk, can logout from the server without<br>
&gt; calling reactor.stop(), as you would kill the GUI. I tried to delete the<br>
&gt; perspective got from the server but it does not work...<br>
<br>
The simplest thing you can do to achieve this is &#39;broker.transport.loseConnection()&#39;.<br>
<br>
Of course, that just unceremoniously drops the connection. &nbsp;You may want to have a &#39;remote_disconnect&#39; method on the server too, if you have any state you would like to cleanly finish up with first.<br>
<br>
Your GUI is already handling disconnection due to network problems though, right? &nbsp;:-) &nbsp;So the modification to make it handle this slightly-cleaner disconnect should be minor. &nbsp;If it doesn&#39;t, see the notifyOnDisconnect API in PB: &lt;<a href="http://twistedmatrix.com/documents/10.0.0/api/twisted.spread.pb.Broker.html#notifyOnDisconnect" target="_blank">http://twistedmatrix.com/documents/10.0.0/api/twisted.spread.pb.Broker.html#notifyOnDisconnect</a>&gt;.<br>

<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://twistedmatrix.com/pipermail/twisted-python/attachments/20100324/dac4c598/attachment-0001.htm" target="_blank">http://twistedmatrix.com/pipermail/twisted-python/attachments/20100324/dac4c598/attachment-0001.htm</a><br>

<br>
------------------------------<br>
<br>
Message: 5<br>
Date: Wed, 24 Mar 2010 13:28:45 +0100<br>
From: Ramiro Alba Queipo &lt;<a href="mailto:raq@cttc.upc.edu">raq@cttc.upc.edu</a>&gt;<br>
Subject: Re: [Twisted-Python] Logout from a perspective broker server<br>
To: Twisted general discussion &lt;<a href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a>&gt;<br>
Message-ID: &lt;1269433725.6222.20.camel@mundo&gt;<br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
Glyph,<br>
<br>
&gt; &gt; I wonder, if I client using pygtk, can logout from the server<br>
&gt; &gt; without<br>
&gt; &gt; calling reactor.stop(), as you would kill the GUI. I tried to delete<br>
&gt; &gt; the<br>
&gt; &gt; perspective got from the server but it does not work...<br>
&gt;<br>
&gt; The simplest thing you can do to achieve this is<br>
&gt; &#39;broker.transport.loseConnection()&#39;.<br>
&gt;<br>
&gt;<br>
&gt; Of course, that just unceremoniously drops the connection. &nbsp;You may<br>
&gt; want to have a &#39;remote_disconnect&#39; method on the server too, if you<br>
&gt; have any state you would like to cleanly finish up with first.<br>
&gt;<br>
After having a look at pb.py code I used<br>
<br>
factory = pb.PBClientFactory()<br>
....<br>
<br>
factory.disconnect()<br>
<br>
Then this makes the server call a &#39;logout&#39; method for the current<br>
perspective, and makes a clean logout. Any comment?<br>
<br>
<br>
&gt;<br>
&gt; Your GUI is already handling disconnection due to network problems<br>
&gt; though, right? &nbsp;:-) &nbsp;So the modification to make it handle this<br>
&gt; slightly-cleaner disconnect should be minor. &nbsp;If it doesn&#39;t, see the<br>
&gt; notifyOnDisconnect API in PB:<br>
&gt; &lt;<a href="http://twistedmatrix.com/documents/10.0.0/api/twisted.spread.pb.Broker.html#notifyOnDisconnect" target="_blank">http://twistedmatrix.com/documents/10.0.0/api/twisted.spread.pb.Broker.html#notifyOnDisconnect</a>&gt;.<br>

<br>
Yeah. I was already using it. Very nice. I also wanted to enable a way<br>
to conecct and disconnect from the client, apart from the client be<br>
aware of a server restart on simply loosing connection. It works<br>
cleanly.<br>
<br>
Really grateful for your info and comments<br>
<br>
Regards<br>
<br>
&gt;<br>
--<br>
Ramiro Alba<br>
<br>
Centre Tecnol?gic de Tranfer?ncia de Calor<br>
<a href="http://www.cttc.upc.edu" target="_blank">http://www.cttc.upc.edu</a><br>
<br>
<br>
Escola T?cnica Superior d&#39;Enginyeries<br>
Industrial i Aeron?utica de Terrassa<br>
Colom 11, E-08222, Terrassa, Barcelona, Spain<br>
Tel: (+34) 93 739 86 46<br>
<br>
<br>
--<br>
Aquest missatge ha estat analitzat per MailScanner<br>
a la cerca de virus i d&#39;altres continguts perillosos,<br>
i es considera que est? net.<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 6<br>
Date: Wed, 24 Mar 2010 13:39:17 +0100<br>
From: Albert Brandl &lt;<a href="mailto:albert.brandl@weiermayer.com">albert.brandl@weiermayer.com</a>&gt;<br>
Subject: [Twisted-Python] NetstringReceiver<br>
To: <a href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a><br>
Message-ID: &lt;<a href="mailto:20100324123917.GA24344@weiermayer.com">20100324123917.GA24344@weiermayer.com</a>&gt;<br>
Content-Type: text/plain; charset=iso-8859-1<br>
<br>
Hi!<br>
<br>
The NetstringReceiver class does not exactly do what I&#39;d expect - see<br>
issue <a href="http://twistedmatrix.com/trac/ticket/4378" target="_blank">http://twistedmatrix.com/trac/ticket/4378</a>. Since we plan to use<br>
netstrings, I am trying to fix it.<br>
<br>
I am not quite sure how to handle certain problems, though, and that&#39;s<br>
where I&#39;d appreciate help. If this is the wrong place to ask this kind of<br>
questions, please redirect me ;-).<br>
<br>
1.) In the current implementation, a NetstringParseError results in a<br>
call to self.transport.loseConnection(). Furthermore the variable<br>
brokenPeer is set to 1. But this variable is ignored. Would it be better<br>
to check it before receiving data? If yes: what is the correct way for a<br>
protocol to handle a broken transport? There is a ConnectionLost<br>
exception, but I&#39;m not sure if / when a Protocol is allowed to raise it.<br>
<br>
2.) The current implementation uses the method dataReceived to assemble<br>
the content of the netstring. When it is complete, the method<br>
stringReceived (which raises a NotImplementedError by default) is called.<br>
But netstrings can be long - would it be better to create a Deferred<br>
instance and call its callback instead? What would be the right place to<br>
create this Deferred?<br>
<br>
3.) I started testing the NetstringReceiver by creating a class comment<br>
with doctests. When I later grepped the sources, I found some doctests,<br>
but there no mention of the doctest module in the test policy document.<br>
Would it be better to use the unittest framework for testing the code?<br>
<br>
Thanks and best regards,<br>
<br>
--<br>
Albert Brandl<br>
Weiermayer Solutions GmbH<br>
4813 Altm?nster | Abteistra?e 12 | Austria<br>
Fon: +43(0)720 70 30 14 | Fax: +43 (0) 7612 88081<br>
<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
<br>
<br>
End of Twisted-Python Digest, Vol 72, Issue 35<br>
**********************************************<br>
</blockquote></div><br>