From 975cea386464dc4f65ea88d67d4a5edfc6989a7e Mon Sep 17 00:00:00 2001 From: misael Date: Tue, 18 Nov 2014 13:50:45 -0300 Subject: [PATCH] Add option to configure Certificate context method, defaulting to TLS --- apnsclient/backends/stdio.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apnsclient/backends/stdio.py b/apnsclient/backends/stdio.py index 5b50ea3..996459f 100644 --- a/apnsclient/backends/stdio.py +++ b/apnsclient/backends/stdio.py @@ -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)