Re: HTTPServer and SSL

2016-04-17 Thread Terry Reedy

On 4/18/2016 1:39 AM, Terry Reedy wrote:

My apologies for the tired, twitchy finger junk post that I noticed 1/2 
second after clicking the wrong button and I wish I oould delete.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: HTTPServer and SSL

2016-04-17 Thread Terry Reedy

On 4/17/2016 10:56 AM, Radek Holý wrote:

Hello,

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

asdfghjkki
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




--
Terry Jan Reedy


--
https://mail.python.org/mailman/listinfo/python-list


HTTPServer and SSL

2016-04-17 Thread Radek Holý
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
-- 
https://mail.python.org/mailman/listinfo/python-list