Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Terry Reedy Newsgroups: comp.lang.python Subject: Re: HTTPServer and SSL Date: Mon, 18 Apr 2016 01:39:19 -0400 Lines: 33 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de 09/zaSmu4Bic/WzHv2Ty+gwlLMVAs6eEvBz13zoNkeJg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'handler': 0.04; 'anymore.': 0.09; 'https': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.10; 'jan': 0.11; '2.7': 0.13; '2014': 0.16; 'handler)': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'reedy': 0.16; 'subject:SSL': 0.16; 'wrote:': 0.16; 'attribute': 0.18; 'explicit': 0.22; 'am,': 0.23; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'not.': 0.27; 'wonder': 0.27; 'http': 0.33; 'safely': 0.33; 'similar': 0.33; 'server': 0.34; 'list': 0.34; 'so,': 0.35; "isn't": 0.35; 'supports': 0.35; 'but': 0.36; 'there': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'method': 0.37; 'received:org': 0.37; 'test': 0.39; 'to:addr:python.org': 0.40; 'hello,': 0.40; 'some': 0.40; 'questions': 0.40; 'received:96': 0.63; 'combining': 0.66; 'approach.': 0.91; 'received:fios.verizon.net': 0.91 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: pool-96-227-207-81.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: Xref: csiph.com comp.lang.python:107242 On 4/17/2016 10:56 AM, Radek Hol=C3=BD wrote: > Hello, > > some people recommend following implementation of a simple HTTP server > that supports SSL: > > asdfghjkki > Handler =3D http.server.BaseHTTPRequestHandlerhttpd =3D > http.server.HTTPServer(("", 4443), Handler) > httpd.socket =3D ssl.wrap_socket(httpd.socket, server_side=3DTrue) > httpd.serve_forever() > > I wonder whether this usage is *supported* or not. The documentation > is not explicit about whether the httpd.socket attribute can be safely > reassigned. Also there were some questions regarding a simple HTTPS > server on this list already and none of the answerers mentioned this > approach. > > Also there used to be a HTTPSServer in the test suite of Python 2.7 in > 2014 that did a similar thing but in the "get_request" method but it > isn't there anymore. > > So, is there a *supported* way of combining http.server.HTTPServer and = ssl? > > Best regards > --=20 Terry Jan Reedy