Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #107180 > unrolled thread

HTTPServer and SSL

Started byRadek Holý <Radek1@holych.org>
First post2016-04-17 16:56 +0200
Last post2016-04-17 16:56 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  HTTPServer and SSL Radek Holý <Radek1@holych.org> - 2016-04-17 16:56 +0200

#107180 — HTTPServer and SSL

FromRadek Holý <Radek1@holych.org>
Date2016-04-17 16:56 +0200
SubjectHTTPServer and SSL
Message-ID<mailman.104.1460911259.6324.python-list@python.org>
Hello,

some people recommend following implementation of a simple HTTP server
that supports SSL:


Handler = http.server.BaseHTTPRequestHandlerhttpd =
http.server.HTTPServer(("", 4443), Handler)
httpd.socket = ssl.wrap_socket(httpd.socket, server_side=True)
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
-- 

Radek

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web