intertwingly

It’s just data

Secure and Authenticated HTTP Server in Python


Before implementing any unsafe methods, like POST, in my Planet Server, I thought it best to take a detour to add authentication and security to the server itself.  This turned out to be straightforward, if not obvious, so it seemed worthwhile to share separately.

This work is based on an ASPN Cookbook entry by Sébastien Martini.  I made two basic modifications.  As I wanted my Handler to be independent of the Server, I used other means to replace the unimplemented makefile method on SSL.Connection with one that does the job. 

I also added Basic Authentication.

All that is left is hooking this up to planet’s config.ini and logging functions.