Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit 4f223b5

Browse files
committed
Use consistent names for SSLContext variable
1 parent 4695044 commit 4f223b5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

hyper/http20/connection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ class HTTP20Connection(object):
5151
:param enable_push: (optional) Whether the server is allowed to push
5252
resources to the client (see
5353
:meth:`get_pushes() <hyper.HTTP20Connection.get_pushes>`).
54-
:SSLContext: (optional) A class with custom certificate settings. If not provided
54+
:ssl_context: (optional) A class with custom certificate settings. If not provided
5555
then hyper's default SSLContext is used instead.
5656
"""
57-
def __init__(self, host, port=None, window_manager=None, enable_push=False, SSLContext=None,
57+
def __init__(self, host, port=None, window_manager=None, enable_push=False, ssl_context=None,
5858
**kwargs):
5959
"""
6060
Creates an HTTP/2 connection to a specific server.
@@ -69,7 +69,7 @@ def __init__(self, host, port=None, window_manager=None, enable_push=False, SSLC
6969
self.host, self.port = host, port
7070

7171
self._enable_push = enable_push
72-
self._SSLContext = SSLContext
72+
self.ssl_context = ssl_context
7373

7474
#: The size of the in-memory buffer used to store data from the
7575
#: network. This is used as a performance optimisation. Increase buffer
@@ -209,7 +209,7 @@ def connect(self):
209209
if self._sock is None:
210210
sock = socket.create_connection((self.host, self.port), 5)
211211

212-
sock, proto = wrap_socket(sock, self.host, self._SSLContext)
212+
sock, proto = wrap_socket(sock, self.host, self.ssl_context)
213213
log.debug("Selected NPN protocol: %s", proto)
214214
assert proto in H2_NPN_PROTOCOLS
215215

hyper/tls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
cert_loc = path.join(path.dirname(__file__), 'certs.pem')
2424

2525

26-
def wrap_socket(sock, server_hostname, SSLContext=None):
26+
def wrap_socket(sock, server_hostname, ssl_context=None):
2727
"""
2828
A vastly simplified SSL wrapping function. We'll probably extend this to
2929
do more things later.
3030
"""
3131
global _context
3232

3333
if _context is None: # pragma: no cover
34-
_context = SSLContext or _init_context()
34+
_context = ssl_context or _init_context()
3535

3636
# the spec requires SNI support
3737
ssl_sock = _context.wrap_socket(sock, server_hostname=server_hostname)

0 commit comments

Comments
 (0)