
🔒Python HTTPS File Server for Windows
📖 What is it?
A lightweight, self-contained HTTPS file server written in Python
that automatically generates self-signed SSL certificates
and serves files from a configurable directory.
⚙️ How it Works
The script leverages Python's built-in http.server and ssl modules
to create a secure web server. On first run, it:
- Checks for existing SSL certificates
- If not found, generates a self-signed certificate using OpenSSL (4096-bit RSA)
- Creates a
files subdirectory for serving content
- Generates a configuration dashboard (index.html) showing all settings
- Starts the HTTPS server on the configured port (default: 8443)
📋 Configuration Options
All settings can be adjusted by modifying variables at the beginning of the script:
| Variable |
Default Value |
Description |
SERVER_PORT |
8443 |
TCP port for HTTPS connections |
SERVER_ADDRESS |
0.0.0.0 |
Bind address (0.0.0.0 = all network interfaces) |
SERVE_DIRECTORY |
files |
Subdirectory for files to serve (relative to script) |
CERT_FILE |
server.crt |
SSL certificate filename |
KEY_FILE |
server.key |
Private key filename |
CERT_VALIDITY_DAYS |
365 |
Certificate validity period in days |
📦 Prerequisites
Note: Make sure OpenSSL is added to your system PATH during installation!
🚀 Usage
Step 1: Save the script as https_fileserver.py
Step 2: Open a terminal/PowerShell in the script directory
Step 3: Run the server:
python https_fileserver.py
Step 4: Place files in the files subdirectory
Step 5: Access via browser at https://localhost:8443
⚠️ Important Security Notice
This server is intended for personal and development use only!
- Do NOT use in production environments
- Do NOT expose to the public internet
- Browsers will show security warnings for self-signed certificates (this is normal)
- For production use, obtain certificates from trusted Certificate Authorities
Author: Vincent Bacher
Created with ❤️ for the CheckMates Community
January 2026
and now to something completely different - CCVS, CCAS, CCTE, CCCS, CCSM elite