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

Commit e12e0de

Browse files
committed
Move to H1 NPN whitelist.
1 parent 06cbfb8 commit e12e0de

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

hyper/http11/connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import socket
1111

1212
from .response import HTTP11Response
13-
from ..tls import wrap_socket, H2_NPN_PROTOCOLS
13+
from ..tls import wrap_socket
1414
from ..http20.bufsocket import BufferedSocket
1515
from ..common.headers import HTTPHeaderMap
1616
from ..common.util import to_bytestring
@@ -87,7 +87,7 @@ def connect(self):
8787

8888
if self.secure:
8989
sock, proto = wrap_socket(sock, self.host)
90-
assert proto not in H2_NPN_PROTOCOLS
90+
assert proto in ('http/1.1', None)
9191

9292
self._sock = BufferedSocket(sock, self.network_buffer_size)
9393

hyper/tls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def wrap_socket(sock, server_hostname):
4040
if _context.check_hostname: # pragma: no cover
4141
ssl.match_hostname(ssl_sock.getpeercert(), server_hostname)
4242

43-
proto = ''
43+
proto = None
4444
with ignore_missing():
4545
proto = ssl_sock.selected_npn_protocol()
4646

test/test_integration_http11.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@
1010
import threading
1111

1212
from hyper.compat import ssl
13-
from hyper.http11.connection import HTTP11Connection
1413
from server import SocketLevelTest
1514

1615
# Turn off certificate verification for the tests.
1716
if ssl is not None:
1817
hyper.tls._context = hyper.tls._init_context()
1918
hyper.tls._context.check_hostname = False
2019
hyper.tls._context.verify_mode = ssl.CERT_NONE
21-
hyper.http11.connection.H2_NPN_PROTOCOLS += ['']
2220

2321

2422
class TestHyperH11Integration(SocketLevelTest):

0 commit comments

Comments
 (0)