Skip to content

Commit

Permalink
Add command line options to http3_client for client certs
Browse files Browse the repository at this point in the history
Make it possible to use client TLS certificates with the HTTP/3 client
demo.

Fixes: #498
  • Loading branch information
jlaine committed Jun 30, 2024
1 parent bb5a03d commit e0d5d27
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions examples/http3_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,11 @@ async def main(
parser.add_argument(
"--ca-certs", type=str, help="load CA certificates from the specified file"
)
parser.add_argument(
"--certificate",
type=str,
help="load the TLS certificate from the specified file",
)
parser.add_argument(
"--cipher-suites",
type=str,
Expand Down Expand Up @@ -482,6 +487,11 @@ async def main(
type=str,
help="write downloaded files to this directory",
)
parser.add_argument(
"--private-key",
type=str,
help="load the TLS private key from the specified file",
)
parser.add_argument(
"-q",
"--quic-log",
Expand Down Expand Up @@ -559,6 +569,10 @@ async def main(
except FileNotFoundError:
pass

# load SSL certificate and key
if args.certificate is not None:
configuration.load_cert_chain(args.certificate, args.private_key)

if uvloop is not None:
uvloop.install()
asyncio.run(
Expand Down

0 comments on commit e0d5d27

Please sign in to comment.