Skip to content

LDAPS CA Certificate not working #6426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
maxdallmair opened this issue May 20, 2025 · 10 comments
Closed

LDAPS CA Certificate not working #6426

maxdallmair opened this issue May 20, 2025 · 10 comments
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. needs info Not enough information provided

Comments

@maxdallmair
Copy link

Hello everyone,

I am running a Nextcloud AIO instance with docker-compose.
I have installed and configured the LDAP plugin. With the check mark in the setting “Turn off SSL certificate verification.” the connection also works promptly. Unfortunately not with SSL.

I have set the ENV variable NEXTCLOUD_TRUSTED_CACERTS_DIR: /srv/nextcloud/ssl where my ROOTCA.crt is located in my compose.

According to this guide, that's the only thing to do. GitHub - nextcloud/all-in-one: 📦 The official Nextcloud installation method. Provides easy deployment and maintenance with most features included in this one Nextcloud instance.

Unfortunately, the connection does not work. I then executed the following command, which I found in a Git issue.
sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ security:certificates:import /usr/local/share/ca-certificates/ROOTCA-JO-DC.crt

The certificate is then also displayed with this command. Unfortunately, the connection still does not work.
sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ security:certificates

ldaps and Port 636 is configured.

Output of sudo docker info

Client: Docker Engine - Community
Version: 28.0.1
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.21.1
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.33.1
Path: /usr/libexec/docker/cli-plugins/docker-compose

Server:
Containers: 12
Running: 10
Paused: 0
Stopped: 2
Images: 23
Server Version: 28.0.1
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
Swarm: inactive
Runtimes: runc io.containerd.runc.v2
Default Runtime: runc
Init Binary: docker-init
containerd version: bcc810d6b9066471b0b6fa75f557a15a1cbf31bb
runc version: v1.2.4-0-g6c52b3f
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.1.0-35-amd64
Operating System: Debian GNU/Linux 12 (bookworm)
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 3.823GiB
Name: cloud
ID: 8b885316-a703-4fda-a7e2-d8187eba8786
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
::1/128
127.0.0.0/8
Live Restore Enabled: false

Docker run command or docker-compose file that you used

services:
nextcloud-aio-mastercontainer:
image: ghcr.io/nextcloud-releases/all-in-one:latest
init: true
restart: always
container_name: nextcloud-aio-mastercontainer # This line is not allowed to be changed as otherwise AIO will not work correctly
volumes:
- nextcloud_aio_mastercontainer:/mnt/docker-aio-config # This line is not allowed to be changed as otherwise the built-in backup solution will not work
- /var/run/docker.sock:/var/run/docker.sock:ro # May be changed on macOS, Windows or docker rootless. See the applicable documentation. If adjusting, don't forget to also set 'WATCHTOWER_DOCKER_SOCKET_PATH'!
network_mode: bridge # add to the same network as docker run would do
ports:
- 80:80 # Can be removed when running behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else). See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md
- 8080:8080
- 8443:8443 # Can be removed when running behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else). See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md
environment: # Is needed when using any of the options below
NEXTCLOUD_TRUSTED_CACERTS_DIR: /srv/nextcloud/ssl # CA certificates in this directory will be trusted by the OS of the nextcloud container (Useful e.g. for LDAPS) See https://github.com/nextcloud/all-in-one#how-to-trust-user-defined-certification-authorities-ca
volumes: # If you want to store the data on a different drive, see https://github.com/nextcloud/all-in-one#how-to-store-the-filesinstallation-on-a-separate-drive
nextcloud_aio_mastercontainer:
name: nextcloud_aio_mastercontainer # This line is not allowed to be changed as otherwise the built-in backup solution will not work

@maxdallmair maxdallmair added the 0. Needs triage Pending approval or rejection. This issue is pending approval. label May 20, 2025
@szaimen
Copy link
Collaborator

szaimen commented May 20, 2025

Hi, can you post the output of sudo docker inspect nextcloud-aio-nextcloud | grep TRUSTED_CACERTS_DIR here?

@szaimen szaimen added the needs info Not enough information provided label May 20, 2025
@maxdallmair
Copy link
Author

Sure, thanks for the quick response!

The output is:
"TRUSTED_CACERTS_DIR=/srv/nextcloud/ssl",

In the folder is the certificate placed
ROOTCA.crt

@szaimen
Copy link
Collaborator

szaimen commented May 20, 2025

Ok, can you alao post the outout of sudo docker logs nextcloud-aio-nextcloud here?

@maxdallmair
Copy link
Author

Sure. I have changed the TLD to cloud.domain.tld in the logs, normally it shows the configured URL

          now              

2025-05-20 04:01:43.507428+00
(1 row)

User required to trust additional CA certificates, running 'update-ca-certificates.'
Enabling Imagick...
Applying one-click-instance settings...
System config value one-click-instance set to boolean true
System config value one-click-instance.user-limit set to integer 100
System config value one-click-instance.link set to string https://nextcloud.com/all-in-one/
support already enabled
Adjusting log files...
System config value upgrade.cli-upgrade-link set to string #2726
System config value logfile set to string /var/www/html/data/nextcloud.log
Config value were not updated
System config value updatedirectory set to string /nc-updater
System config value maintenance_window_start set to integer 100
Applying network settings...
System config value allow_local_remote_servers set to boolean true
System config value davstorage.request_timeout set to integer 3600
System config value trusted_domains => 1 set to string cloud.domain.tld
System config value overwrite.cli.url set to string https://cloud.domain.tld/
System config value documentation_url.server_logs set to string #5425
System config value htaccess.RewriteBase set to string /
.htaccess has been updated
System config value dbpersistent set to boolean false
System config value auth.bruteforce.protection.enabled set to boolean true
System config value ratelimit.protection.enabled set to boolean true
System config value files_external_allow_create_new_local set to boolean false
notify_push is up-to-date or no updates could be found
System config value trusted_proxies => 0 set to string 127.0.0.1
System config value trusted_proxies => 1 set to string ::1
System config value trusted_proxies => 10 set to string 172.18.0.0/16
Config value were not updated
richdocuments is up-to-date or no updates could be found
Config value were not updated
Config value were not updated
spreed is up-to-date or no updates could be found
Config value recording_servers of app spreed deleted
System config value enabledPreviewProviders => 0 set to string OC\Preview\Imaginary
System config value enabledPreviewProviders => 23 set to string OC\Preview\ImaginaryPDF
System config value preview_imaginary_url set to string http://nextcloud-aio-imaginary:9000
System config value preview_imaginary_key set to string 4fa1145d5081444c640e5d382e65b6085f17c389081f4a51
whiteboard is up-to-date or no updates could be found
Config value were not updated
Config value were not updated
listen.allowed_clients = 127.0.0.1,::1,172.18.0.11,fd52:d44b:6b1a::b,172.18.0.2,fd52:d44b:6b1a::2
Waiting for nextcloud-aio-apache to become available...
Activating Collabora config...
✓ Reset callback url autodetect
Checking configuration
🛈 Configured WOPI URL: https://cloud.domain.tld
🛈 Configured public WOPI URL: https://cloud.domain.tld
🛈 Configured callback URL:

✓ Fetched /hosting/discovery endpoint
✓ Valid mimetype response
✓ Valid capabilities entry
✓ Fetched /hosting/capabilities endpoint
✓ Detected WOPI server: Collabora Online Development Edition 24.04.13.3

Collabora URL (used for Nextcloud to contact the Collabora server):
https://cloud.domain.tld
Collabora public URL (used in the browser to open Collabora):
https://cloud.domain.tld
Callback URL (used by Collabora to connect back to Nextcloud):
autodetected (will use the same URL as your user for browsing Nextcloud)
Cronjob successfully exited.
Waiting for database to start...
now

2025-05-20 07:30:03.939921+00
(1 row)

User required to trust additional CA certificates, running 'update-ca-certificates.'
Applying one-click-instance settings...
System config value one-click-instance set to boolean true
System config value one-click-instance.user-limit set to integer 100
System config value one-click-instance.link set to string https://nextcloud.com/all-in-one/
support already enabled
Adjusting log files...
System config value upgrade.cli-upgrade-link set to string #2726
System config value logfile set to string /var/www/html/data/nextcloud.log
Config value were not updated
System config value updatedirectory set to string /nc-updater
System config value maintenance_window_start set to integer 100
Applying network settings...
System config value allow_local_remote_servers set to boolean true
System config value davstorage.request_timeout set to integer 3600
System config value trusted_domains => 1 set to string cloud.domain.tld
System config value overwrite.cli.url set to string https://cloud.domain.tld/
System config value documentation_url.server_logs set to string #5425
System config value htaccess.RewriteBase set to string /
.htaccess has been updated
System config value dbpersistent set to boolean false
System config value auth.bruteforce.protection.enabled set to boolean true
System config value ratelimit.protection.enabled set to boolean true
System config value files_external_allow_create_new_local set to boolean false
notify_push is up-to-date or no updates could be found
System config value trusted_proxies => 0 set to string 127.0.0.1
System config value trusted_proxies => 1 set to string ::1
System config value trusted_proxies => 10 set to string 172.18.0.0/16
Config value were not updated
richdocuments is up-to-date or no updates could be found
Config value were not updated
Config value were not updated
spreed is up-to-date or no updates could be found
Config value recording_servers of app spreed deleted
System config value enabledPreviewProviders => 0 set to string OC\Preview\Imaginary
System config value enabledPreviewProviders => 23 set to string OC\Preview\ImaginaryPDF
System config value preview_imaginary_url set to string http://nextcloud-aio-imaginary:9000
System config value preview_imaginary_key set to string 4fa1145d5081444c640e5d382e65b6085f17c389081f4a51
whiteboard is up-to-date or no updates could be found
Config value were not updated
Config value were not updated
listen.allowed_clients = 127.0.0.1,::1,172.18.0.7,fd52:d44b:6b1a::7,172.18.0.10,fd52:d44b:6b1a::a
Waiting for nextcloud-aio-apache to become available...
Activating Collabora config...
✓ Reset callback url autodetect
Checking configuration
🛈 Configured WOPI URL: https://cloud.domain.tld
🛈 Configured public WOPI URL: https://cloud.domain.tld
🛈 Configured callback URL:

✓ Fetched /hosting/discovery endpoint
✓ Valid mimetype response
✓ Valid capabilities entry
✓ Fetched /hosting/capabilities endpoint
✓ Detected WOPI server: Collabora Online Development Edition 24.04.13.3

Collabora URL (used for Nextcloud to contact the Collabora server):
https://cloud.domain.tld
Collabora public URL (used in the browser to open Collabora):
https://cloud.domain.tld
Callback URL (used by Collabora to connect back to Nextcloud):
autodetected (will use the same URL as your user for browsing Nextcloud)

@maxdallmair
Copy link
Author

Is there any additional information you need?
Yesterday I tried again to find my issue or resolving it in general, but I do not see what could be wrong.

@szaimen
Copy link
Collaborator

szaimen commented May 21, 2025

The logs look fine honestly. And sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ security:certificates:import /usr/local/share/ca-certificates/ROOTCA-JO-DC.crt should usually add it and make the connection work. Maybe the DNS is not working? Which LDAP address did you specify?

@maxdallmair
Copy link
Author

Hmm, yes, when I run the command and run then sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ security:certificates I can see the certificate.

I want to use ldaps://FQDN and trying it also with ldaps://IP and port 636 both works without check "Switch off the SSL certificate check."
I have a user and password entered and use DC=domain,DC=local

@szaimen
Copy link
Collaborator

szaimen commented May 21, 2025

So it seems to work? What am I missing?

@maxdallmair
Copy link
Author

Ah, sorry, I mean when I check "Switch off the SSL certificate check." it works. When I uncheck it, it does not work.

Tested / saw it on the Configuration wrong or right and trying with test configuration and user sync.

@szaimen
Copy link
Collaborator

szaimen commented May 21, 2025

I see. I fear this might be a general Nextcloud server issue. Probably best if you report this to https://github.com/nextcloud/server since we only bundle the server software here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. needs info Not enough information provided
Projects
None yet
Development

No branches or pull requests

2 participants