This repository was archived by the owner on Jan 13, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11
11
12
12
13
13
NPN_PROTOCOL = 'h2'
14
- H2_NPN_PROTOCOLS = [NPN_PROTOCOL , 'h2-16' , 'h2-15' , 'h2-14' ] # All h2s we support.
14
+ H2_NPN_PROTOCOLS = [NPN_PROTOCOL , 'h2-16' , 'h2-15' , 'h2-14' ]
15
15
SUPPORTED_NPN_PROTOCOLS = H2_NPN_PROTOCOLS + ['http/1.1' ]
16
16
17
17
22
22
# Work out where our certificates are.
23
23
cert_loc = path .join (path .dirname (__file__ ), 'certs.pem' )
24
24
25
+
25
26
def wrap_socket (sock , server_hostname ):
26
27
"""
27
28
A vastly simplified SSL wrapping function. We'll probably extend this to
@@ -35,8 +36,8 @@ def wrap_socket(sock, server_hostname):
35
36
# the spec requires SNI support
36
37
ssl_sock = _context .wrap_socket (sock , server_hostname = server_hostname )
37
38
# Setting SSLContext.check_hostname to True only verifies that the
38
- # post-handshake servername matches that of the certificate. We also need to
39
- # check that it matches the requested one.
39
+ # post-handshake servername matches that of the certificate. We also need
40
+ # to check that it matches the requested one.
40
41
if _context .check_hostname : # pragma: no cover
41
42
try :
42
43
ssl .match_hostname (ssl_sock .getpeercert (), server_hostname )
You can’t perform that action at this time.
0 commit comments