Gitlab SSL connection

I’ve spent quite some time looking into getting ssl working for gitlab.

I have a containers running gitlab via docker

CONTAINER ID   IMAGE                          COMMAND                  CREATED       STATUS                 PORTS
                NAMES
797e3c6818a7   gitlab/gitlab-runner:latest    "/usr/bin/dumb-init …"   2 hours ago   Up 2 hours
                gitlab-runner
ba53133df54b   gitlab/gitlab-ee:16.5.1-ee.0   "/assets/wrapper"        2 hours ago

Which runs a docker compose file:

version: '3.6'
services:
  web:
    image: 'gitlab/gitlab-ee:16.5.1-ee.0'
    restart: always
    hostname: 'testgitlab.columbus.com'
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'https://testgitlab.columbus.com'
        # Add any other gitlab.rb configuration here, each on its own line
		nginx['enable'] = true
		nginx['listen_port'] = 443
		nginx['ssl_certificate'] = "/etc/gitlab/ssl/certificate.pem"
		nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/certificate.pem"
    ports:
      - '80:80'
      - '443:443'
      - '22:22'
    volumes:
      - '$GITLAB_HOME/config:/etc/gitlab'
      - '$GITLAB_HOME/logs:/var/log/gitlab'
      - '$GITLAB_HOME/data:/var/opt/gitlab'
    shm_size: '256m'

I’ve set it up so I can mount my directories. Under /srv/gitlab/config/ssl is where I create the certificates using:

openssl req -newkey rsa:2048 -nodes -keyout certificate.key -x509 -days 365 -subj /CN=localhost -out certificate.crt

Each time I log into https://testgitlab.columbus.com I get the following error message:

This site can’t provide a secure connection via chrome

and

Secure Connection Failed
An error occurred during a connection to #.#.#.#:8443. SSL received a record that exceeded the maximum permissble length

Error Code: SSL_ERROR_RX_RECORD_TOO_LONG … via Firefox

I’ve searched google for the SSL error and tried many ways.

Any help would be much appreciated.

I figured it out.
The line nginx[‘listen_port’] = 443 is not needed.

1 Like