-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
http.server with HTTPS fails to bind IPv6 addresses #134168
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
Comments
cc @donBarbos |
This comment has been minimized.
This comment has been minimized.
thank you very much, my bad. really one of the problems is that we use |
I've opened #134176 for the |
I think both of these two bugs are related to the class HTTPSDualStackServer(ThreadingHTTPSServer):
def server_bind(self):
with contextlib.suppress(Exception):
self.socket.setsockopt(
socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0) # bind IPv6 addresses
return super().server_bind()
def finish_request(self, request, client_address):
self.RequestHandlerClass(request, client_address, self,
directory=args.directory) # handle --directory flag Would it be acceptable to address both issues in a single PR? They share the same root cause, and separating the fixes would introduce unnecessary code duplication. |
Oh so if the root issue is the same, yes a single PR is better. |
…ory` when serving over HTTPS (python#134169) --------- (cherry picked from commit 2fd09b0) Co-authored-by: ggqlq <[email protected]>
…-directory` when serving over HTTPS (pythonGH-134169) (cherry picked from commit 2fd09b0) Co-authored-by: ggqlq <[email protected]>
Thank you for the report, the fix and your patience! |
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
When HTTPS is enabled, the command-line interface of
http.server
can't bind IPv6 addresses correctly and the--directory
flag doesn't work.bind IPv6
HTTPS server throw an exception when I was trying to bind a IPv6 address, but HTTP server can bind IPv6 address.
--directory
issueThe HTTPS server always uses the work path of current terminal as its root directory and ignores the
--directory
flag:CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
http.server
CLI support for IPv6 and--directory
when serving over HTTPS (#134169) #134630The text was updated successfully, but these errors were encountered: