Discussion:
[bottlepy] Use SSL and set user id in the built-in server
António Manuel Dias
2016-04-02 18:45:06 UTC
Permalink
Hello.

I made two very small changes in the WSGIRefServer server adapter to test a
small bottle application I am working on: (1) allowing the server to use
SSL (using the standard ssl python module) and (2) allowing the server
process to change its user id (using the standard pwd module, unix only),
to start the process as root (being able to bind to a port < 1024) and then
switch to a user with less privileges. With this change I can start the
application like this:

# HTTP, unprivileged user
bottle.run(host='localhost', port=8080)

# HTTP, default port, start as root, switch to bottle user
bottle.run(host='localhost', port=80, user='bottle')

# HTTPS, unprivileged user
bottle.run(host='localhost', port=4443, keyfile='server.key',
certfile='server.crt')

# HTTPS, default port, start as root, switch to bottle user
bottle.run(host='localhost', port=443, keyfile='server.key',
certfile='server.crt', user='bottle')

The altered WSGIRefServer bottle class is in the attached file -- it was
tested with python 3 only. Can someone please look at it to see potential
problems?

Thank you,
--
António Manuel Dias
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.

---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...