Skip to content

Commit

Permalink
Add command line option for http3_client to negotiate QUIC v2
Browse files Browse the repository at this point in the history
As part of the interoperability tests, we want to exercise the scenario
where the client starts using QUIC version 1 then negotiates usage of
QUIC version 2 using compatible version negotiation.
  • Loading branch information
jlaine committed Jun 30, 2024
1 parent e0d5d27 commit c411453
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions examples/http3_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from aioquic.quic.configuration import QuicConfiguration
from aioquic.quic.events import QuicEvent
from aioquic.quic.logger import QuicFileLogger
from aioquic.quic.packet import QuicProtocolVersion
from aioquic.tls import CipherSuite, SessionTicket

try:
Expand Down Expand Up @@ -465,6 +466,16 @@ async def main(
action="store_true",
help="include the HTTP response headers in the output",
)
parser.add_argument(
"--insecure",
action="store_true",
help="do not validate server certificate",
)
parser.add_argument(
"--legacy-http",
action="store_true",
help="use HTTP/0.9",
)
parser.add_argument(
"--max-data",
type=int,
Expand All @@ -476,12 +487,11 @@ async def main(
help="per-stream flow control limit (default: %d)" % defaults.max_stream_data,
)
parser.add_argument(
"-k",
"--insecure",
"--negotiate-v2",
action="store_true",
help="do not validate server certificate",
help="start with QUIC v1 and try to negotiate QUIC v2",
)
parser.add_argument("--legacy-http", action="store_true", help="use HTTP/0.9")

parser.add_argument(
"--output-dir",
type=str,
Expand Down Expand Up @@ -558,6 +568,12 @@ async def main(
configuration.max_data = args.max_data
if args.max_stream_data:
configuration.max_stream_data = args.max_stream_data
if args.negotiate_v2:
configuration.original_version = QuicProtocolVersion.VERSION_1
configuration.supported_versions = [
QuicProtocolVersion.VERSION_2,
QuicProtocolVersion.VERSION_1,
]
if args.quic_log:
configuration.quic_logger = QuicFileLogger(args.quic_log)
if args.secrets_log:
Expand Down

0 comments on commit c411453

Please sign in to comment.