Skip to content

Commit

Permalink
Make ssl classes have generic __init__ signature
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Mar 17, 2017
1 parent dae9d48 commit 894b08d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions cheroot/ssl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def __init__(self, certificate, private_key, certificate_chain=None, ciphers=Non
self.private_key = private_key
self.certificate_chain = certificate_chain
self.ciphers = ciphers
self.context = None

def wrap(self, sock):
raise NotImplemented
Expand Down
14 changes: 8 additions & 6 deletions cheroot/ssl/pyopenssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ def shutdown(self, *args):
class pyOpenSSLAdapter(Adapter):
"""A wrapper for integrating pyOpenSSL with CherryPy."""

context = None
"""An instance of SSL.Context."""

certificate = None
"""The filename of the server SSL certificate."""

Expand All @@ -164,13 +161,18 @@ class pyOpenSSLAdapter(Adapter):
This is needed for cheaper "chained root" SSL certificates, and should be
left as None if not required."""

def __init__(self, certificate, private_key, certificate_chain=None):
context = None
"""An instance of SSL.Context."""

ciphers = None
"""The ciphers list of SSL."""

def __init__(self, certificate, private_key, certificate_chain=None, ciphers=None):
if SSL is None:
raise ImportError('You must install pyOpenSSL to use HTTPS.')

super(pyOpenSSLAdapter, self).__init__(certificate, private_key, certificate_chain)
super(pyOpenSSLAdapter, self).__init__(certificate, private_key, certificate_chain, ciphers)

self.context = None
self._environ = None

def bind(self, sock):
Expand Down

0 comments on commit 894b08d

Please sign in to comment.