From the README:
cyclone is a Twisted protocol, therefore it may be used in conjunction
with any other protocol implemented in Twisted.
If Twisted supports SSL then cyclone supports it e.g.:
#file: cyclone-ssl.py
import cyclone.web
class IndexHandler(cyclone.web.RequestHandler):
def get(self):
self.write("hello world")
factory = cyclone.web.Application([(r"/", IndexHandler)])
portstr = "ssl:4443:privateKey=server_key.pem:certKey=server_cert.pem"
# make twisted app
from twisted.application import service, strports
application = service.Application("cyclone-ssl")
strports.service(portstr, factory).setServiceParent(application)
Run it as:
$ twistd -ny cyclone-ssl.py
The part that activates ssl is portstr
. It specifies that the server serves on 4443
port and uses server_key.pem
as its private key, server_cert.pem
as a certificate.