[3.14] gh-134168: fix http.server CLI support for IPv6 and --directory when serving over HTTPS (#134169)#134630
Merged
picnixz merged 1 commit intopython:3.14from May 24, 2025
Merged
Conversation
This was referenced May 24, 2025
Member
Author
|
@ggqlq Can you check that this works on 3.14 (not 3.15). It should work but we never know. TiA. For this one, can you check both IPv4 and IPv6? |
…-directory` when serving over HTTPS (pythonGH-134169) (cherry picked from commit 2fd09b0) Co-authored-by: ggqlq <124190229+ggqlq@users.noreply.github.com>
b931d45 to
06f32d7
Compare
Member
Author
|
(I forced push because I wanted the cherry-picker message (I managed to make it work)) |
Contributor
|
All passed! IPv4 + SSL$ ./python -m http.server -b 127.0.0.1 --tls-cert ~/ssl/localhost.crt --tls-key ~/ssl/localhost.key
Serving HTTPS on 127.0.0.1 port 8000 (https://127.0.0.1:8000/) ...
$ curl -k https://127.0.0.1:8000
# ...
<ul>
<li><a href=".azure-pipelines/">.azure-pipelines/</a></li>
<li><a href=".coveragerc">.coveragerc</a></li>IPv4 + other directory$ ./python -m http.server -b 127.0.0.1 -d ~/test
Serving HTTP on 127.0.0.1 port 8000 (http://127.0.0.1:8000/) ...
$ curl http://127.0.0.1:8000
# ...
<ul>
<li><a href="1">1</a></li>
<li><a href="2">2</a></li>
<li><a href="3">3</a></li>IPv4 + other directory + SSL$ ./python -m http.server -b 127.0.0.1 --tls-cert ~/ssl/localhost.crt --tls-key ~/ssl/localhost.key -d ~/test
Serving HTTPS on 127.0.0.1 port 8000 (https://127.0.0.1:8000/) ...
$ curl -k https://127.0.0.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$ ./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 directory$ ./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 + other directory + SSL$ ./python -m http.server -b ::1 --tls-cert ~/ssl/localhost.crt --tls-key ~/ssl/localhost.key -d ~/test
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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(cherry picked from commit 2fd09b0)
Co-authored-by: ggqlq 124190229+ggqlq@users.noreply.github.com