Configure HTTPS¶
By default, TestGen serves its web UI and API over HTTP. To serve them over HTTPS, provide an SSL certificate and private key. When both are configured, TestGen serves the UI and the API over TLS.
Prerequisites¶
- TestGen instance installed using dk-installer.exe, as outlined in Install on Windows, or dk-installer, as outlined in Install on Mac/Linux or Install Enterprise.
- An SSL certificate file and its private key file, in PEM format, for the domain used to access TestGen.
Tip
When installing with dk-installer, you can enable HTTPS during installation instead of afterward by passing the --ssl-cert-file and --ssl-key-file options.
See Installation options.
Configure SSL¶
The configuration steps depend on the install mode.
Docker mode¶
-
Navigate to the directory that contains the
docker-compose.ymlfile for TestGen.- If the instance was installed using dk-installer.exe, the file can be located under "AppData\Local\DataKitchenApps".
- If the instance was installed using dk-installer, the file can be located in the folder from which the Python installer was executed.
-
Add the certificate and key as bind mounts on the engine service, so they are available inside the container.
-
Add the following lines under the x-common-variables section to point TestGen at the mounted files.
-
Map the host's HTTPS port to the UI in the engine service's
portssection, for example, to serve the UI on port 443. -
If you set
TG_UI_BASE_URLorTG_BASE_URL, update them to use thehttpsscheme and the HTTPS port. -
Restart the application.
Pip mode¶
-
Open the
~/.testgen/config.envfile in a text editor. -
Add the paths to your certificate and key files (one variable per line, no quotes).
-
If you set
TG_UI_BASE_URLorTG_BASE_URL, update them to use thehttpsscheme. -
Restart the application. Stop the running TestGen process with Ctrl+C in the terminal where it is running, then start it again.
Note
If you terminate TLS at a reverse proxy (for example, NGINX) in front of TestGen, configure the certificate on the proxy instead and leave SSL_CERT_FILE and SSL_KEY_FILE unset.