Skip to main content

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:

  1. Download and install OpenSSL for Windows from the OpenSSL for Windows download page{rel="nofollow"}.
  2. Navigate to the OpenSSL installation directory, typically C:\Program Files\OpenSSL-Win64\bin.
  3. Open a command prompt as an administrator and run openssl.
  4. 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.
  5. Move the localhost.key and localhost.crt files to your Gunbot folder.

macOS

For macOS users:

  1. Open Terminal and change directory to your Gunbot folder.
  2. 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:

  1. Open Terminal. Ensure OpenSSL is installed via your package manager.
  2. 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:

  1. In the config.js file, set the https parameter to true.
  2. Place your certificate files (localhost.key and localhost.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.