The mkcert.sh script is a CLI tool used to generate and manage local development SSL certificates for OpenLiteSpeed running in Docker. It automates the process of creating certificates via mkcert, copying them into the container, and reconfiguring OpenLiteSpeed templates to enable HTTPS for specific domains.
Prerequisites
- A running OpenLiteSpeed Docker container (default name:
litespeed). - The domain must already be added to the environment (e.g., via
bash bin/domain.sh -a <domain>) before generating certificates.
Common Workflows
1. Install mkcert
If you do not have mkcert installed on your host machine, use the --install flag. This will attempt to install it using your system's package manager (Chocolatey for Windows, Homebrew for macOS, or apt/dnf/yum/zypper for Linux) and configure the local CA.
2. Generate and Configure SSL for a Domain
To create a certificate for a domain (and its www variant) and automatically configure OpenLiteSpeed to use it:
bash bin/mkcert.sh --domain example.test
3. Remove SSL Configuration for a Domain
To revert a domain to standard HTTP and remove the generated certificate files from both the host and the container:
bash bin/mkcert.sh --remove --domain example.test
# Install mkcert
bash bin/mkcert.sh --install
# Generate SSL for a domain
bash bin/mkcert.sh --domain example.test
# Remove SSL for a domain
bash bin/mkcert.sh --remove --domain example.test