Repository navigation
--no-verify CLI flag is a no-op: SSL verification is not disabled
#3809
Replies: 2 comments
|
I checked this against current
With the proposed This was a Codex-generated harness checking the arguments passed to |
|
Confirmed end to end with a real handshake: on httpx 0.28.1 + click 8.5.0, |
Uh oh!
There was an error while loading. Please reload this page.
The
--no-verifyCLI flag is a no-op: runninghttpx --no-verify <url>still validates certificates,so requests to hosts with expired or invalid certificates keep failing.
Cause
In
httpx/_main.pythe option is declared without an explicitflag_value:Recent versions of click no longer infer
flag_valuefromdefaultfor boolean flags:Option.flag_valuestaysUNSET, andOption.flag_activation_valueresolves a missingflag_valuetoTrue:Activating the flag therefore stores
True— the same value as the default — andverifyis always
True.Suggested fix
Pass
flag_value=Falseso that activating--no-verifysetsverify=False, while omittingit keeps the
default=Truebehaviour:@click.option( "--no-verify", "verify", is_flag=True, default=True, + flag_value=False, help="Disable SSL verification.", )Commit with this change (fork): korewayume@caa9f5b
Branch (1 commit ahead of
master): https://github.com/korewayume/httpx/tree/no-verify-patchThe one-line patch above is ready to be applied if maintainers agree with the diagnosis.
Environment
click==8.*perpyproject.toml)All reactions