mirror of
https://github.com/mitmproxy/mitmproxy.git
synced 2024-11-27 23:30:28 +00:00
[quic] dataclass changes
This commit is contained in:
parent
7285c250ff
commit
6360f388df
@ -215,10 +215,7 @@ class TestTlsConfig:
|
||||
],
|
||||
ciphers_client="CHACHA20_POLY1305_SHA256",
|
||||
)
|
||||
ctx = context.Context(
|
||||
connection.Client(("client", 1234), ("127.0.0.1", 8080), 1605699329),
|
||||
tctx.options,
|
||||
)
|
||||
ctx = _ctx(tctx.options)
|
||||
|
||||
tls_start = quic.QuicTlsData(ctx.client, context=ctx)
|
||||
ta.quic_start_client(tls_start)
|
||||
@ -289,10 +286,7 @@ class TestTlsConfig:
|
||||
def test_quic_start_server_verify_ok(self, hostname, tdata):
|
||||
ta = tlsconfig.TlsConfig()
|
||||
with taddons.context(ta) as tctx:
|
||||
ctx = context.Context(
|
||||
connection.Client(("client", 1234), ("127.0.0.1", 8080), 1605699329),
|
||||
tctx.options,
|
||||
)
|
||||
ctx = _ctx(tctx.options)
|
||||
ctx.server.address = (hostname, 443)
|
||||
tctx.configure(
|
||||
ta,
|
||||
@ -336,10 +330,7 @@ class TestTlsConfig:
|
||||
def test_quic_start_server_insecure(self):
|
||||
ta = tlsconfig.TlsConfig()
|
||||
with taddons.context(ta) as tctx:
|
||||
ctx = context.Context(
|
||||
connection.Client(("client", 1234), ("127.0.0.1", 8080), 1605699329),
|
||||
tctx.options,
|
||||
)
|
||||
ctx = _ctx(tctx.options)
|
||||
ctx.server.address = ("example.mitmproxy.org", 443)
|
||||
ctx.client.alpn_offers = [b"h3"]
|
||||
|
||||
|
@ -750,7 +750,6 @@ def test_stream_concurrent_get_connection(tctx: context.Context):
|
||||
"""Test that an immediate second request for the same domain does not trigger a second connection attempt."""
|
||||
playbook, cff = start_h3_client(tctx)
|
||||
playbook.hooks = False
|
||||
flow = tutils.Placeholder(HTTPFlow)
|
||||
server = tutils.Placeholder(connection.Server)
|
||||
sff = FrameFactory(server, is_client=False)
|
||||
assert (
|
||||
|
@ -348,7 +348,7 @@ class TestRawQuicLayer:
|
||||
)
|
||||
|
||||
def test_open_connection(self, tctx: context.Context):
|
||||
server = connection.Server(("other", 80))
|
||||
server = connection.Server(address=("other", 80))
|
||||
|
||||
def echo_new_server(ctx: context.Context):
|
||||
echo_layer = TlsEchoLayer(ctx)
|
||||
@ -869,7 +869,7 @@ class TestClientTLS:
|
||||
|
||||
# Echo
|
||||
_test_echo(playbook, tssl_client, tctx.client)
|
||||
other_server = connection.Server(None)
|
||||
other_server = connection.Server(address=None)
|
||||
assert (
|
||||
playbook
|
||||
>> events.DataReceived(other_server, b"Plaintext")
|
||||
@ -1017,7 +1017,7 @@ class TestClientTLS:
|
||||
client_layer.debug = ""
|
||||
assert (
|
||||
playbook
|
||||
>> events.DataReceived(connection.Server(None), b"data on other stream")
|
||||
>> events.DataReceived(connection.Server(address=None), b"data on other stream")
|
||||
<< commands.Log(">> DataReceived(server, b'data on other stream')", DEBUG)
|
||||
<< commands.Log(
|
||||
"[quic] Swallowing DataReceived(server, b'data on other stream') as handshake failed.",
|
||||
|
Loading…
Reference in New Issue
Block a user