Secure Your Gunbot Interface with SSL/TLS
Use this guide to run the Gunbot browser interface over HTTPS on Windows, macOS, or Linux. It covers generating a self-signed certificate and configuring Gunbot to use it.
Info
SSL/TLS (Secure Sockets Layer/Transport Layer Security) are cryptographic protocols that provide secure communication over a computer network. HTTPS is HTTP over SSL/TLS.
Preparing for HTTPS Setup in Gunbot
If you prefer a certificate from a recognized provider like Let's Encrypt, use that certificate instead of the self-signed one below. Make sure the filenames match your configuration and the files are in the Gunbot folder.
Generating a Self-Signed Certificate
Windows
Follow these steps to generate a certificate on Windows:
- Download and install OpenSSL for Windows from the OpenSSL for Windows download page.
- Navigate to the OpenSSL installation directory, typically
C:\Program Files\OpenSSL-Win64\bin. - Open a command prompt as an administrator and run
openssl. - Execute the command:
req -newkey rsa:2048 -nodes -keyout localhost.key -x509 -days 365 -out localhost.crt. Fill in the prompted details or leave them blank. - Move the
localhost.keyandlocalhost.crtfiles to your Gunbot folder.
macOS
For macOS users:
- Open Terminal and change directory to your Gunbot folder.
- Run the command:
openssl req -newkey rsa:2048 -nodes -keyout localhost.key -x509 -days 365 -out localhost.crt. Provide the country code when prompted; other fields are optional.
Linux
Linux users can generate a certificate using these steps:
- Open Terminal. Ensure OpenSSL is installed via your package manager.
- Within your Gunbot folder, execute:
openssl req -newkey rsa:2048 -nodes -keyout localhost.key -x509 -days 365 -out localhost.crt. As with macOS, enter the country code when prompted.
Configuring Gunbot
Once you have your certificate, configure Gunbot for HTTPS:
- In the
config.jsfile, set thehttpsparameter totrue. - Place your certificate files (
localhost.keyandlocalhost.crt) in the Gunbot folder.
Handling Browser Warnings
Upon first connection to the Gunbot GUI with a self-signed certificate, your browser may show a security warning. This is expected for self-signed certificates. You can create a permanent exception in your browser to avoid the prompt in the future.