mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-02-01 15:55:28 +00:00
fix alpn
This commit is contained in:
parent
c428578c83
commit
dd317aa5d2
@ -19,6 +19,8 @@ import language.websockets
|
|||||||
from . import utils, log
|
from . import utils, log
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
from netlib.http.http1 import HTTP1Protocol
|
||||||
|
|
||||||
logging.getLogger("hpack").setLevel(logging.WARNING)
|
logging.getLogger("hpack").setLevel(logging.WARNING)
|
||||||
|
|
||||||
|
|
||||||
@ -284,7 +286,7 @@ class Pathoc(tcp.TCPClient):
|
|||||||
self.sslinfo = None
|
self.sslinfo = None
|
||||||
if self.ssl:
|
if self.ssl:
|
||||||
try:
|
try:
|
||||||
alpn_protos = [b'http1.1'] # TODO: move to a new HTTP1 protocol
|
alpn_protos = [HTTP1Protocol.ALPN_PROTO_HTTP1]
|
||||||
if self.use_http2:
|
if self.use_http2:
|
||||||
alpn_protos.append(http2.HTTP2Protocol.ALPN_PROTO_H2)
|
alpn_protos.append(http2.HTTP2Protocol.ALPN_PROTO_H2)
|
||||||
|
|
||||||
|
@ -290,7 +290,7 @@ class TestDaemonHTTP2(_TestDaemon):
|
|||||||
c.connect()
|
c.connect()
|
||||||
|
|
||||||
_, kwargs = c.convert_to_ssl.call_args
|
_, kwargs = c.convert_to_ssl.call_args
|
||||||
assert set(kwargs['alpn_protos']) == set([b'http1.1', b'h2'])
|
assert set(kwargs['alpn_protos']) == set([b'http/1.1', b'h2'])
|
||||||
|
|
||||||
def test_request(self):
|
def test_request(self):
|
||||||
c = pathoc.Pathoc(
|
c = pathoc.Pathoc(
|
||||||
|
Loading…
Reference in New Issue
Block a user