GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-85162: Add HTTPSServer to http.server by donbarbos · Pull Request #129607 · python/cpython

Conversation

@donbarbos

@donbarbos donbarbos commented Feb 3, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

I decided to resume the work on the implementation of HTTPS server in http.server module.
I am ready to respond in time and make changes :-)

I'm opening a new PR because this #20923 had been clearly abandoned.

I took the liberty of defining a single style in Lib/http/server.py file, otherwise everything would have been completely confusing.

cc @tiran @remilapeyre @jaswdr
(who was involved with the previous PR)

  • Issue: Make http.server support SSL #85162

📚 Documentation preview 📚: https://cpython-previews--129607.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
donbarbos added 5 commits February 2, 2025 16:47
@donbarbos
Add support HTTPS in http.server
5bfc939
@donbarbos
Correct style code
b382985
@donbarbos
Add tests for HTTPSServer
4cc80c5
@donbarbos
Update options
75fff2b
@donbarbos
Update docs
64c3070
@bedevere-app bedevere-app Bot added the awaiting review label Feb 3, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Feb 3, 2025
Make http.server support SSL #85162
Closed
@donbarbos
Merge branch 'main' into issue-85162
e4652a7
@donbarbos donbarbos changed the title gh-85162: Add HTTPS support to http.server.HTTPServer gh-85162: Add HTTPSServer to http.server Feb 3, 2025
picnixz
picnixz previously requested changes Feb 3, 2025
View reviewed changes

@picnixz picnixz left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry but I can't review what is new and necessary from what is not (even with separate commits). While the style is inconsistent, let's address it in a separate PR if it's really that disturbing.

Note that since we sqash-merge at the end, the style changes will be part of the diff as well making the history harder to review.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

donbarbos reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Lib/http/server.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting review label Feb 3, 2025
@bedevere-app

bedevere-app Bot commented Feb 3, 2025

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added the awaiting changes label Feb 3, 2025
@donbarbos
Revert "Correct style code"
abd949c
This reverts commit b382985.
@donbarbos

donbarbos commented Feb 3, 2025

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting change review and removed awaiting changes labels Feb 3, 2025
@bedevere-app

bedevere-app Bot commented Feb 3, 2025

Copy link
Copy Markdown

Thanks for making the requested changes!

@picnixz: please review the changes made to this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app
bedevere-app Bot requested a review from picnixz February 3, 2025 14:17
@donbarbos
Merge branch 'main' into issue-85162
8fc2311
picnixz
picnixz reviewed Feb 3, 2025
View reviewed changes

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The interface doesn't look the nicest to me. Is there an obvious reason why we can't add SSL support to HTTPServer even though it's named HTTPServer? Or should we really make HTTPSServer inherit from HTTPServer?

I am travelling and it's hard to review on mobile but @gpshead may have some preliminary comments on the design. I've left some comments but they can be disregarded for now until the design is fixed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/http.server.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/http.server.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/http.server.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/http.server.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/http/server.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/http/server.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/http.server.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/http.server.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/http/server.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Misc/NEWS.d/next/Library/2025-02-02-00-30-09.gh-issue-85162.BNF_aJ.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@donbarbos

donbarbos commented Feb 3, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

@picnixz
Initially, I was guided by the comment left by @tiran in the previous PR:
#20923 (review)

I don't want to change the HTTP server interface and overcomplicate it. I also think this matches the principle of separation of responsibilities.

but I'm open to discussion

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@picnixz

picnixz commented Feb 3, 2025

Copy link
Copy Markdown
Member

Ok for a separate class but whether it should be a subclass or not is something I don't know if we should do. I don't know which layout will be the best one in the long term (for now let's keep it as a subclass).

I don't think I have thought enough about the broader implications so I will hold future reviews for now. I think I need another opinion on this interface (btw, I'm not sure tiran is still active actually, hence the reason why I requested gpshead's opinion).

donbarbos reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

donbarbos added 2 commits February 3, 2025 23:14
@donbarbos
Update docs and correct raising errors
4f587bd
@donbarbos
Add helper method _create_context
db796cd
@donbarbos
donbarbos requested a review from picnixz February 3, 2025 20:25
gpshead
gpshead reviewed Feb 3, 2025
View reviewed changes

@gpshead gpshead left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regardless of review, I still wonder if we actually want this in the stdlib? But the implementation is not complicated so I don't think it'll be a maintenance burden in that regard.

The challenge is it may add more reasons for people to file security issues. Despite our existing bold warning up top in https://docs.python.org/3.14/library/http.server.html that http.server is not a production quality secure server.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/http.server.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/http.server.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/http/server.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/http/server.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@donbarbos

donbarbos commented Feb 3, 2025

Copy link
Copy Markdown
Contributor Author

I think it's important to add this because there are many useful use cases.
all such people first go to the documentation before opening an issue.

And I don't see any reason why they would open an issue if they were already familiar with the concept of http.server

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@donbarbos
Update docs and replace password option
96d4a68
@donbarbos
donbarbos requested a review from gpshead February 4, 2025 08:56
picnixz
picnixz previously approved these changes Feb 15, 2025
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Feb 15, 2025
@donbarbos

donbarbos commented Mar 7, 2025

Copy link
Copy Markdown
Contributor Author

@gpshead what do you think now about the merge of this PR?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

donbarbos added 2 commits March 16, 2025 14:48
@donbarbos
Merge branch 'main' into issue-85162
4c68c27
@donbarbos
Update cli description
3ca55d1
@donbarbos
donbarbos requested a review from picnixz March 16, 2025 11:27
picnixz
picnixz reviewed Mar 16, 2025
View reviewed changes

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but I missed one possible case

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/http.server.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/http.server.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/http.server.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_httpservers.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@picnixz
picnixz dismissed their stale review March 16, 2025 11:38

missed a case

@bedevere-app bedevere-app Bot added awaiting review and removed awaiting merge labels Mar 16, 2025
@donbarbos
Update doc
3daf484
picnixz
picnixz approved these changes Apr 4, 2025
View reviewed changes

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an improved blurb/what's new and I think it's good to go.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/test/test_httpservers.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_httpservers.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Misc/NEWS.d/next/Library/2025-02-02-00-30-09.gh-issue-85162.BNF_aJ.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/whatsnew/3.14.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Apr 4, 2025
@donbarbos
Update docs
8b84be2
@donbarbos donbarbos mentioned this pull request Apr 4, 2025
Cover the password prompt case for SSLContext.load_cert_chain with a test #132102
Closed
@picnixz picnixz self-assigned this Apr 4, 2025
@picnixz

picnixz commented Apr 4, 2025

Copy link
Copy Markdown
Member

I'll let it open a few days so that @gpshead can have a look, else I'll merge this before the end of the week.

donbarbos reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gpshead
gpshead approved these changes Apr 5, 2025
View reviewed changes
picnixz
picnixz reviewed Apr 5, 2025
View reviewed changes
Comment thread Doc/whatsnew/3.14.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@picnixz
Update Doc/whatsnew/3.14.rst
50e0ed5
picnixz
picnixz reviewed Apr 5, 2025
View reviewed changes
Comment thread Doc/whatsnew/3.14.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@picnixz
Update Doc/whatsnew/3.14.rst
4f36fbf
@picnixz
picnixz enabled auto-merge (squash) April 5, 2025 08:26
@picnixz
picnixz disabled auto-merge April 5, 2025 08:26
@picnixz
picnixz enabled auto-merge (squash) April 5, 2025 08:28
@picnixz
picnixz merged commit 37bc386 into python:main Apr 5, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label Apr 5, 2025
@donbarbos

donbarbos commented Apr 5, 2025

Copy link
Copy Markdown
Contributor Author

Thanks a lot everyone

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@picnixz picnixz picnixz approved these changes
@gpshead gpshead gpshead approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@picnixz picnixz

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@donbarbos @picnixz @gpshead
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.