Federation - Servers not turning green because of curl error

Nextcloud version (eg, 29.0.5): 29.0.4
Operating system and version (eg, Ubuntu 24.04): Ubuntu 22.04
Apache or nginx version (eg, Apache 2.4.25): 2.4.52
PHP version (eg, 8.3): 8.3.9

The issue you are facing:

I am trying to set up federation between 2 nextcloud servers, but in the admin interface they don´t turn green

Is this the first time you’ve seen this error? (Y/N): y

Steps to replicate it:

  1. Add Nextcloud B as trusted server in Nextcloud A
  2. Add Nextcloud A as trusted server in Nextcloud B
  3. See the logs in admin interface

The output of your Nextcloud log in Admin > Logging:

On Nextcloud A I can see the following entry:
remote server not trusted (http://xxx.com/nextcloud) while getting shared secret 

-> strangely, I only added "https://xxx.com" as trusted server. I don´t know how "/nextcloud" is added

On Nextcloud B I can see the following entry:
cURL error 28: Operation timed out after 3000 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)