WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Protocol fallback sends HTTP to HTTPS port (443) causing 400 errors #2335

@ehsandeep

Description

@ehsandeep

httpx version:

latest

Current Behavior:

When httpx falls back from HTTPS to HTTP on targets with explicit port 443, it keeps the same port, causing 400 The plain HTTP request was sent to HTTPS port errors, i.e resulted as valid / open host but it's actually not.

Expected Behavior:

Before:

$ echo "1.117.60.202:443" | httpx -probe
http://1.117.60.202:443 [FAILED]  # 400 error - HTTP to HTTPS port

After:

$ echo "1.117.60.202:443" | httpx -probe
http://1.117.60.202:80 [SUCCESS]  # Falls back to correct port

Steps To Reproduce:

echo 1.117.60.202:443 | httpx -silent -title
http://1.117.60.202:443 [400 The plain HTTP request was sent to HTTPS port]

Metadata

Metadata

Assignees

Labels

Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions