Oauth2 Integration with n8n Error: connect ECONNREFUSED

My Mautic version is:
My PHP version is: 4.4.9 - app/prod
My Database type and version is: percona/percona-server:

My problem is: I keep trying to connect n8n to mautic over Oauth2 and it keeps failing, I am using docker images with fpm and percona, here is my docker-compose:

services:
  database:
    image: percona/percona-server:latest
    container_name: database
    environment:
      MYSQL_ROOT_PASSWORD: root
    ports:
      - "3306:3306"
    volumes:
      - database:/var/lib/mysql
    restart: always
    networks:
      - mauticnet
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci --sql-mode=""

  mautic:
    container_name: mautic
    build: .
    volumes:
      - mauticdata:/var/www/html
      - /etc/ssl:/etc/ssl:ro
    environment:
      - MAUTIC_DB_HOST=root
      - MAUTIC_DB_USER=root
      - MAUTIC_DB_PASSWORD=root
      - MAUTIC_DB_NAME=root
      - MAUTIC_RUN_CRON_JOBS=true
      - MAUTIC_TRUSTED_PROXIES=["0.0.0.0/0"]
      - MAUTIC_INSTALL_FORCE=true

    restart: always
    networks:
      - mauticnet
    ports:
      - "443:443"

networks:
  mauticnet:
    name: mauticnet
    external: true


volumes:
  database:
  mauticdata:

I have also extended the Dockerfile:

FROM mautic/mautic:v4

ARG DOMAIN=mautic.example.com

#RUN [ -z "$DOMAIN" ] && echo "DOMAIN is required" && exit 1 || true

COPY ssl.conf /etc/apache2/sites-available/default-ssl.conf

RUN sed -i "s/DOMAIN/$DOMAIN/g" /etc/apache2/sites-available/default-ssl.conf

RUN a2enmod ssl && a2ensite default-ssl.conf

here is the ssl.conf file as well:

<IfModule mod_ssl.c>
        <VirtualHost *:443>
                DocumentRoot /var/www/html
                ServerName DOMAIN
          
                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined

                SSLEngine on

                # Intermediate configuration, tweak to your needs
                SSLProtocol             all -SSLv2 -SSLv3
                SSLCipherSuite          ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS
                SSLHonorCipherOrder     on
                SSLCompression          off

                SSLOptions +StrictRequire

                LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" vhost_combined
                LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost_common

                SSLCertificateFile /etc/ssl/server.crt
                SSLCertificateKeyFile /etc/ssl/server.key
        </VirtualHost>
</IfModule>

this error happens after I obtain the client secret and id and insert the redirect uri the provided n8n redirect uri and then try to connect, a page open’s up in chrome, asks for username, password and then when i hit them this error appears.

These errors are showing in the log:

#### Error: connect ECONNREFUSED ip:443

More details

Failed to connect. The window can be closed now.

Steps I have tried to fix the problem: