Foreman-Proxy - certificate verify failed (self signed certificate in certificate chain)

I have just installed a foreman content proxy on EL9 following the docs Installing a Smart Proxy Server 3.11 on Enterprise Linux with custom certificates. It works fine. No errors registering.

Running on the main server:

# foreman-proxy-certs-generate --foreman-proxy-fqdn foreman9-content.example.com \
         --certs-tar /root/foreman9-content.example.com-certs.tar \
         --server-cert /root/certs/foreman9-content/2024/foreman9-content_cert.cer \
         --server-key /root/certs/foreman9-content/2024/foreman9-content-2024.key \
         --server-ca-cert /root/certs/foreman9-content/2024/foreman9-content_interm.cer

Certificate and key in pem format. ca-cert is the chain starting with the issuer of the server cert ending with the root ca.

Then running the exact command printed on the new content proxy.

This is a new content proxy. There was no previous foreman installation nor any foreman-installer run before.