-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-134168: http.server with HTTPS fails to bind IPv6 addresses and ignores --directory flag #134169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant
Conversation
Most changes to Python blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
This comment was marked as resolved.
This comment was marked as resolved.
And please add tests. I don't understand why |
Most changes to Python blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Misc/NEWS.d/next/Library/2025-05-18-13-23-29.gh-issue-134168.hgx3Xg.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
…gx3Xg.rst Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Should we move the runtime tests from PR #132540 to this one? |
Oh I thought that the other PR was merged. NVM, i'll merge the other one so that you can extend the existing tests. |
Ok, because we have some failures on the build bots, I've reverted the runtime tests but kept the static tests. Since this fix requires serving real files to check whether it works or not, I'll just assume that it locally works and be happy with it (I mean, what could go wrong?) I'm still planning to fix the runtime tests so that we can have a good coverage but it won't be a priority. |
I couldn't reproduce the IPv6 issue because I have disabled IPv6 and I'm too lazy to re-enable it. However, I can confirm that this fixes the |
@ggqlq Can you manually confirm that IPv6 + SSL works, IPv6 + other directory works, IPv6 + SSL + other directory works. I confirmed with IPv4 o my side. |
I think they can all work properly. IPv6 + SSL$ ./python -m http.server -b ::1 --tls-cert ~/ssl/localhost.crt --tls-key ~/ssl/localhost.key
Serving HTTPS on ::1 port 8000 (https://[::1]:8000/) ...
$ curl -k https://[::1]:8000
# ...
<ul>
<li><a href=".azure-pipelines/">.azure-pipelines/</a></li>
<li><a href=".coveragerc">.coveragerc</a></li>
# ... IPv6 + other directorytree ~/test
~/test
├── 1
├── 2
└── 3
1 directory, 3 files
$ ./python -m http.server -b ::1 -d ~/test
Serving HTTP on ::1 port 8000 (http://[::1]:8000/) ...
$ curl http://[::1]:8000
# ...
<ul>
<li><a href="1">1</a></li>
<li><a href="2">2</a></li>
<li><a href="3">3</a></li>
</ul> IPv6 + SSL + other directory$ ./python -m http.server -b ::1 -d ~/test --tls-cert ~/ssl/localhost.crt --tls-key ~/ssl/localhost.key
Serving HTTPS on ::1 port 8000 (https://[::1]:8000/) ...
$ curl -k https://[::1]:8000
# ...
<ul>
<li><a href="1">1</a></li>
<li><a href="2">2</a></li>
<li><a href="3">3</a></li>
</ul> |
Great! |
Thanks @picnixz for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry, @picnixz, I could not cleanly backport this to
|
I'll take care of the bp. |
@picnixz Thank you! |
…ory` when serving over HTTPS (python#134169) --------- (cherry picked from commit 2fd09b0) Co-authored-by: ggqlq <124190229+ggqlq@users.noreply.github.com>
…-directory` when serving over HTTPS (pythonGH-134169) (cherry picked from commit 2fd09b0) Co-authored-by: ggqlq <124190229+ggqlq@users.noreply.github.com>
I add a new HTTPSDualStackServer class(like 'DualStackServer') in _main function to handle IPv6 addresses and the
--directory
flag.