hi all, i run into this problem “<br><br><br>”The debugged program raised the exception unhandled Error<br>"[('PEM routines', 'PEM_read_bio', 'no start line'), ('SSL routines', 'SSL_CTX_use_PrivateKey_file', 'PEM lib')]"<br>
File: /usr/lib/python2.5/site-packages/Twisted-10.0.0-py2.5-linux-i686.egg/twisted/internet/ssl.py, Line: 99" <br><br><br> ( usr/lib/python25/site-packages/Twisted-10.0.0-py2.5-linux-i686.egg/twisted/internet/ssl.py line 99 )<br>
<br> def cacheContext(self):<br> if self._context is None:<br> ctx = self._contextFactory(self.sslmethod)<br> # Disallow SSLv2! It's insecure! SSLv3 has been around since<br> # 1996. It's time to move on.<br>
ctx.set_options(SSL.OP_NO_SSLv2)<br> ctx.use_certificate_file(self.certificateFileName)<br> ctx.use_privatekey_file(self.privateKeyFileName) # Line: 99 <br> self._context = ctx<br>
<br>here is the way i create privkey file :<br> $ openssl genrsa > privkey.pem <br><br>then<br> $ openssl req -new -x509 -key privkey.pem -out cacert.pem -days 1000<br><br>i have checked the cacert.pem file it do has 'strt line ' ££BEGIN CERTIFICATE££££<br>
<br><br> part of my code :<br><br><br>class syslogOptions(usage.Options): <br> optParameters = [['cert', 'c', '/home/ssltest/cacert.pem','SSL Server certificate'],<br> ['ip', 'i', None, 'IP Address to listen on']]<br>
def postOptions(self):<br> if (not self.opts['cert']) or (not os.path.isfile(self.opts['cert'])):<br> raise usage.UsageError, "%s: is not a file" % self.opts['cert']<br>
. . . <br>syslogSSL = syslogFactory() <br> syslogSSL.protocol = outputTCP <br> ctx = ssl.DefaultOpenSSLContextFactory(config.opts['cert'], config.opts['cert']) <br>
.. .. . <br> reactor.listenSSL(708, syslogSSL , ctx, interface=config.opts['ip']) <br> reactor.run() <br><br>any ideas ? ...<br><br><br><br><br><br><br><br><div class="gmail_quote">2010/3/25 <span dir="ltr"><<a href="mailto:twisted-python-request@twistedmatrix.com">twisted-python-request@twistedmatrix.com</a>></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>
<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>
<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 'help' to<br>
<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>
<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 "Re: Contents of Twisted-Python digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Re: Nothing Succeeds Like Success (Stories) (David)<br>
2. Logout from a perspective broker server (Ramiro Alba Queipo)<br>
3. Re: stdio.StandardIO blocks? (Glyph Lefkowitz)<br>
4. Re: Logout from a perspective broker server (Glyph Lefkowitz)<br>
5. Re: Logout from a perspective broker server (Ramiro Alba Queipo)<br>
6. NetstringReceiver (Albert Brandl)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Tue, 23 Mar 2010 10:48:41 -0600<br>
From: David <<a href="mailto:dvkeeney@gmail.com">dvkeeney@gmail.com</a>><br>
Subject: Re: [Twisted-Python] Nothing Succeeds Like Success (Stories)<br>
To: Twisted general discussion <<a href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a>><br>
Message-ID:<br>
<<a href="mailto:6e04113a1003230948j41fd0e5bn53ceda6970b36e43@mail.gmail.com">6e04113a1003230948j41fd0e5bn53ceda6970b36e43@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
On Mon, Mar 22, 2010 at 8:39 PM, Glyph Lefkowitz<br>
<<a href="mailto:glyph@twistedmatrix.com">glyph@twistedmatrix.com</a>> wrote:<br>
<br>
> If you'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'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. The streaming server<br>
allows users to stream large SQL 'dump' 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 -> 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 <<a href="mailto:raq@cttc.upc.edu">raq@cttc.upc.edu</a>><br>
Subject: [Twisted-Python] Logout from a perspective broker server<br>
To: Twisted general discussion <<a href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a>><br>
Message-ID: <1269369036.6222.11.camel@mundo><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'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'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 <<a href="mailto:glyph@twistedmatrix.com">glyph@twistedmatrix.com</a>><br>
Subject: Re: [Twisted-Python] stdio.StandardIO blocks?<br>
To: Twisted general discussion <<a href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a>><br>
Message-ID: <<a href="mailto:6EB44FA1-3F26-433F-A2B3-3FE4AC3A5BD0@twistedmatrix.com">6EB44FA1-3F26-433F-A2B3-3FE4AC3A5BD0@twistedmatrix.com</a>><br>
Content-Type: text/plain; charset="us-ascii"<br>
<br>
<br>
On Mar 23, 2010, at 10:00 AM, Willy Lai wrote:<br>
<br>
> What I want, is writing stuff in the console, without interrupting the<br>
> ping mechanism.<br>
> (The pings and pongs in my case should continue to be sent while typing<br>
> stuff in the console)<br>
<br>
Without a *complete* program example, we can'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. Please see <<a href="http://sscce.org/" target="_blank">http://sscce.org/</a>> for details on what types of examples would be useful.<br>
<br>
Based on your simple description, this really should work. If it didn't, 'twistd' wouldn'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 <<a href="mailto:glyph@twistedmatrix.com">glyph@twistedmatrix.com</a>><br>
Subject: Re: [Twisted-Python] Logout from a perspective broker server<br>
To: Twisted general discussion <<a href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a>><br>
Message-ID: <<a href="mailto:44DAEAB5-A177-4367-BBE0-98475F236004@twistedmatrix.com">44DAEAB5-A177-4367-BBE0-98475F236004@twistedmatrix.com</a>><br>
Content-Type: text/plain; charset="us-ascii"<br>
<br>
<br>
On Mar 23, 2010, at 2:30 PM, Ramiro Alba Queipo wrote:<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>
The simplest thing you can do to achieve this is 'broker.transport.loseConnection()'.<br>
<br>
Of course, that just unceremoniously drops the connection. You may want to have a 'remote_disconnect' 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? :-) So the modification to make it handle this slightly-cleaner disconnect should be minor. If it doesn't, see the notifyOnDisconnect API in PB: <<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>>.<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 <<a href="mailto:raq@cttc.upc.edu">raq@cttc.upc.edu</a>><br>
Subject: Re: [Twisted-Python] Logout from a perspective broker server<br>
To: Twisted general discussion <<a href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a>><br>
Message-ID: <1269433725.6222.20.camel@mundo><br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
Glyph,<br>
<br>
> > I wonder, if I client using pygtk, can logout from the server<br>
> > without<br>
> > calling reactor.stop(), as you would kill the GUI. I tried to delete<br>
> > the<br>
> > perspective got from the server but it does not work...<br>
><br>
> The simplest thing you can do to achieve this is<br>
> 'broker.transport.loseConnection()'.<br>
><br>
><br>
> Of course, that just unceremoniously drops the connection. You may<br>
> want to have a 'remote_disconnect' method on the server too, if you<br>
> have any state you would like to cleanly finish up with first.<br>
><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 'logout' method for the current<br>
perspective, and makes a clean logout. Any comment?<br>
<br>
<br>
><br>
> Your GUI is already handling disconnection due to network problems<br>
> though, right? :-) So the modification to make it handle this<br>
> slightly-cleaner disconnect should be minor. If it doesn't, see the<br>
> notifyOnDisconnect API in PB:<br>
> <<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>>.<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>
><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'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'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 <<a href="mailto:albert.brandl@weiermayer.com">albert.brandl@weiermayer.com</a>><br>
Subject: [Twisted-Python] NetstringReceiver<br>
To: <a href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a><br>
Message-ID: <<a href="mailto:20100324123917.GA24344@weiermayer.com">20100324123917.GA24344@weiermayer.com</a>><br>
Content-Type: text/plain; charset=iso-8859-1<br>
<br>
Hi!<br>
<br>
The NetstringReceiver class does not exactly do what I'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's<br>
where I'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'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>