Skip to content

Commit

Permalink
Add option to configure Certificate context method, defaulting to TLS
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbepresent committed Nov 18, 2014
1 parent 7ebf38a commit 975cea3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apnsclient/backends/stdio.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
class Certificate(BaseCertificate):
""" pyOpenSSL certificate implementation. """

def load_context(self, cert_string=None, cert_file=None, key_string=None, key_file=None, passphrase=None):
def load_context(self, cert_string=None, cert_file=None, key_string=None, key_file=None, passphrase=None, context_method=OpenSSL.SSL.TLSv1_METHOD):
""" Initialize and load certificate context. """
context = OpenSSL.SSL.Context(OpenSSL.SSL.SSLv3_METHOD)
context = OpenSSL.SSL.Context(context_method)
if passphrase is not None and not isinstance(passphrase, six.binary_type):
passphrase = six.b(passphrase)

Expand Down

0 comments on commit 975cea3

Please sign in to comment.