Issues Connecting n8n to GitLab with Custom SSL Certificate

Hello n8n Community,

I’m facing an issue where my n8n instance (running in a Docker container) cannot connect to my GitLab instance, which is also containerized and accessible via https://gitlab.local.mydomain. Both services are hosted on the same server. My GitLab instance uses a custom SSL certificate, which I’ve added to the ca-certificates.crt file in the n8n container to ensure it’s trusted. Despite this, n8n cannot establish a secure connection to GitLab, and I encounter the following error when attempting OAuth or direct HTTPS requests:

cssCopy code

{"code":0,"message":"Unable to connect to gitlab.local.mydomain:443"}

Here’s what I’ve done so far:

  1. Added the custom SSL certificate to the n8n Docker container’s ca-certificates.crt.
  2. Verified that the certificate appears at the end of ca-certificates.crt file within the container.
  3. Ensured DNS resolution works for gitlab.local.mydomain from within the n8n container.
  4. Set the NODE_EXTRA_CA_CERTS environment variable pointing to the custom certificate.

Despite these steps, the connection issue persists. I’m looking for advice on how to troubleshoot or resolve this connectivity problem. Here are some specific questions:

  • Does n8n have an internal trust store that I need to update separately from the system’s CA store?
  • Are there known issues or additional configurations needed when using custom SSL certificates with n8n in Docker?
  • Could Docker networking or DNS settings be affecting SSL/TLS verification in a way I haven’t accounted for?

Any insights, suggestions, or guidance from the community would be greatly appreciated!

Thank you!

  • n8n version:0.212.0
  • Database (default: SQLite): sqlite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via docker compose
  • Operating system: ubuntu

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

i actually update n8n to last version and now i have
Error: getaddrinfo ENOTFOUND gitlab.local.mydomain
More details
Failed to connect. The window can be closed now.

I still have problem resolving the dns from the docker compose instance

hello @Luca_Pierabella

Have you tried to use an HTTP Request node in n8n to check that it can reach your GitLab instance? (or the curl command inside the n8n container)

What is the output of the docker ps command from the docker host?

Have you checked the GitLab instance from your pc?

i actually solved adding the dns in the docker-compose file

version: "3"

services:
  n8n:
    container_name: n8n
    image: n8nio/n8n:latest
    restart: always
    ports:
      - "5678:5678"
    dns:
    - 192.168.0.99
2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.