Skip to content

Make http.server support SSL #85162

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

Closed
remilapeyre mannequin opened this issue Jun 16, 2020 · 4 comments
Closed

Make http.server support SSL #85162

remilapeyre mannequin opened this issue Jun 16, 2020 · 4 comments
Labels
stdlib Python modules in the Lib dir topic-SSL type-feature A feature request or enhancement

Comments

@remilapeyre
Copy link
Mannequin

remilapeyre mannequin commented Jun 16, 2020

BPO 40990
Nosy @remilapeyre
PRs
  • bpo-40990: Add HTTPS support to http.server.HTTPServer #20923
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2020-06-16.12:51:47.004>
    labels = ['type-bug', 'library', '3.10']
    title = 'Make http.server support SSL'
    updated_at = <Date 2021-10-27.11:31:35.995>
    user = 'https://github.com/remilapeyre'

    bugs.python.org fields:

    activity = <Date 2021-10-27.11:31:35.995>
    actor = 'Fred'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2020-06-16.12:51:47.004>
    creator = 'remi.lapeyre'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40990
    keywords = ['patch']
    message_count = 3.0
    messages = ['371647', '394021', '405087']
    nosy_count = 2.0
    nosy_names = ['remi.lapeyre', 'Fred']
    pr_nums = ['20923']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue40990'
    versions = ['Python 3.10']

    Linked PRs

    @remilapeyre
    Copy link
    Mannequin Author

    remilapeyre mannequin commented Jun 16, 2020

    It's a bit outside of its original scope but with more and more application requiring HTTPS it is sometime needed even when doing some simple tests or local development.

    It's quite easy to have an SSL certificate, either auto-signed or using Let's Encrypt but configuring Nginx or HAProxy just to serve a local directory on localhost is tedious.

    I think just wrapping the socket in SSLSocket and adding two flags on the command line would be enough?

    @remilapeyre remilapeyre mannequin added 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jun 16, 2020
    @Fred
    Copy link
    Mannequin

    Fred mannequin commented May 20, 2021

    It could look for a existing certificate in a well-known location, and could fallback to an self-signed certificate that could be shipped with Python.

    @Fred
    Copy link
    Mannequin

    Fred mannequin commented Oct 27, 2021

    How is this going? Any progress?

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @kaisxu
    Copy link

    kaisxu commented Sep 26, 2023

    Just check, how is the progress?

    @picnixz picnixz added type-feature A feature request or enhancement and removed type-bug An unexpected behavior, bug, or error 3.10 only security fixes labels Feb 3, 2025
    picnixz pushed a commit that referenced this issue Apr 5, 2025
    #129607)
    
    The `http.server` module now supports serving over HTTPS using the `http.server.HTTPSServer` class.
    This functionality is also exposed by the command-line interface (`python -m http.server`) through the
    `--tls-cert`, `--tls-key` and `--tls-password-file` options.
    @picnixz picnixz closed this as completed Apr 5, 2025
    seehwan pushed a commit to seehwan/cpython that referenced this issue Apr 16, 2025
    …r HTTPS (python#129607)
    
    The `http.server` module now supports serving over HTTPS using the `http.server.HTTPSServer` class.
    This functionality is also exposed by the command-line interface (`python -m http.server`) through the
    `--tls-cert`, `--tls-key` and `--tls-password-file` options.
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir topic-SSL type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants