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

Commit a40ba14

Browse files
committed
Offer support for h2-14 through h2-16.
1 parent ced45e4 commit a40ba14

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hyper/http20/tls.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212

1313
NPN_PROTOCOL = 'h2-16'
14-
SUPPORTED_NPN_PROTOCOLS = ['http/1.1', NPN_PROTOCOL]
14+
H2_NPN_PROTOCOLS = [NPN_PROTOCOL, 'h2-15', 'h2-14'] # All h2s we support.
15+
SUPPORTED_NPN_PROTOCOLS = ['http/1.1'] + H2_NPN_PROTOCOLS
1516

1617

1718
# We have a singleton SSLContext object. There's no reason to be creating one
@@ -40,7 +41,7 @@ def wrap_socket(sock, server_hostname):
4041
ssl.match_hostname(ssl_sock.getpeercert(), server_hostname)
4142

4243
with ignore_missing():
43-
assert ssl_sock.selected_npn_protocol() == NPN_PROTOCOL
44+
assert ssl_sock.selected_npn_protocol() in H2_NPN_PROTOCOLS
4445

4546
return ssl_sock
4647

0 commit comments

Comments
 (0)