twonds / punjab

BOSH connection manager
MIT License
183 stars 49 forks source link

punjab ignoring ssl parameters #31

Closed amolkul closed 11 years ago

amolkul commented 11 years ago

I'm running punjab in ssl mode using following command : twistd -r epoll -l /var/log/punjab.log punjab -v --ssl= --ssl_cert=/root/punjab_cacert.pem --ssl_privkey=/root/punjab_privkey.pem

It starts properly, but in log there is no indication that it has started in ssl mode. It is listening on 5280 port. When I try to connect to punjab using openssl, it hangs (i.e openssl hangs without any output) openssl s_client -connect 127.0.0.1:5280

Is there any mistake in my command above ? The certificates are self signed certificates.

twonds commented 11 years ago

--ssl= is blank. I needs to be set to some value. That should probably be fixed since the value is only used to indicate you want to ssl_cert and ssl_privkey

amolkul commented 11 years ago

If I give it some value like say 'true', it gives following error and quits. The service does not start. Command : twistd -r epoll -l /var/log/punjab.log punjab -v --ssl=true --ssl_cert=/root/punjab_cacert.pem --ssl_privkey=/root/punjab_privkey.pem

/usr/lib64/python2.6/site-packages/twisted/words/protocols/jabber/sasl_mechanisms.py:10: DeprecationWarning: the md5 module is deprecated; use hashlib instead import md5, binascii, random, time, os Traceback (most recent call last): File "/usr/bin/twistd", line 21, in run() File "/usr/lib64/python2.6/site-packages/twisted/scripts/twistd.py", line 27, in run app.run(runApp, ServerOptions) File "/usr/lib64/python2.6/site-packages/twisted/application/app.py", line 694, in run runApp(config) File "/usr/lib64/python2.6/site-packages/twisted/scripts/twistd.py", line 23, in runApp _SomeApplicationRunner(config).run() File "/usr/lib64/python2.6/site-packages/twisted/application/app.py", line 411, in run self.application = self.createOrGetApplication() File "/usr/lib64/python2.6/site-packages/twisted/application/app.py", line 489, in createOrGetApplication ser = plg.makeService(self.config.subOptions) File "/usr/lib/python2.6/site-packages/punjab-0.15-py2.6.egg/twisted/plugins/punjab_plugin.py", line 42, in makeService return punjab.makeService(options) File "/usr/lib/python2.6/site-packages/punjab-0.15-py2.6.egg/punjab/init.py", line 95, in makeService SSL.SSLv23_METHOD,) File "/usr/lib/python2.6/site-packages/punjab-0.15-py2.6.egg/punjab/ssl.py", line 9, in init ssl.DefaultOpenSSLContextFactory.init(self, _args, *_kwargs) File "/usr/lib64/python2.6/site-packages/twisted/internet/ssl.py", line 78, in init self.cacheContext() File "/usr/lib/python2.6/site-packages/punjab-0.15-py2.6.egg/punjab/ssl.py", line 12, in cacheContext ctx = self._contextFactory(self.sslmethod) AttributeError: OpenSSLContextFactoryChaining instance has no attribute '_contextFactory'

twonds commented 11 years ago

What version of twisted are you running?

amolkul commented 11 years ago

Sorry, my bad. I was using the twistd rpms that got installed using yum. I did not cross check their version with the install.txt in punjab.