Create a self signed certificate for https - SaberStrat/gitlab-configs GitHub Wiki

Openssl oneliner to create a self-signed certificate with private key to enable https for a self-hosted Gitlab.

openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes -keyout private_key.key -out certificate.crt -subj "/CN=example.com" -addext "subjectAltName=DNS:example.com,DNS:gitlab.example.com,DNS:kube-ma-01.example.com,IP:192.168.0.3,IP:192.168.1.3,IP:192.168.1.4,IP:192.168.1.5"

Source: https://stackoverflow.com/a/41366949/4473699