Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb 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.
Uh oh!
There was an error while loading.Please reload this page.
And please add tests. I don't understand why |
Uh oh!
There was an error while loading.Please reload this page.
Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Uh oh!
There was an error while loading.Please reload this page.
Misc/NEWS.d/next/Library/2025-05-18-13-23-29.gh-issue-134168.hgx3Xg.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
…gx3Xg.rstCo-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.keyServing 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└── 31 directory, 3 files$ ./python -m http.server -b ::1 -d~/testServing 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.keyServing 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! |
2fd09b0
intopython:mainUh oh!
There was an error while loading.Please reload this page.
Sorry,@ggqlq and@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 commit2fd09b0)Co-authored-by: ggqlq <124190229+ggqlq@users.noreply.github.com>
GH-134630 is a backport of this pull request to the3.14 branch. |
…-directory` when serving over HTTPS (pythonGH-134169)(cherry picked from commit2fd09b0)Co-authored-by: ggqlq <124190229+ggqlq@users.noreply.github.com>
Uh oh!
There was an error while loading.Please reload this page.
I add a new HTTPSDualStackServer class(like 'DualStackServer') in _main function to handle IPv6 addresses and the
--directory
flag.