0xdead8ead / basic-auth-simple-https-server

Python 3 SimpleHTTPServer over HTTPS TLS with Basic Auth

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Basic Auth Simple HTTPS Server

Python 3 SimpleHTTPServer over HTTPS using Basic Auth

Uses Python 3 standard library. Creates ./files directory from which files can be served. Logging outputs to simple.log. Cert & Key file must be created prior to running.

Get Lets Encrypt HTTPS Cert for Server:

A Lets Encrypt TLS certificate can be generated with the following commands

sudo certbot certonly --register-unsafely-without-email --standalone -d <domain_name>
sudo cat /etc/letsencrypt/live/<domain_name>/fullchain.pem > server.pem
sudo cat /etc/letsencrypt/live/<domain_name>/privkey.pem >> server.pem

Alternatively a self signed certificate can be generated with the following command

openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes

Authorization Key Generation:

Basic Auth Username and Password is generated with the following command

echo -n "<username>:<password>" | base64

Running the Simple HTTPS Server:

python simple-https-server_basic-auth.py

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

Python 3 SimpleHTTPServer over HTTPS TLS with Basic Auth

License:MIT License


Languages

Language:Python 100.0%