SSL_connect returned=1 errno=0 peeraddr=10.34.120.147:443 state=error: certificate verify failed (hostname mismatch)

Hi,
I an having an issue with installing my first foreman instance. My setup consists on a separate database, separate Puppet CA server and a separate multi Foreman(s). I have install the database, and the Puppet CA server (foreman-installer) but I am having a problem with my Foreman installation.

foreman-installer
–puppet-server=false
–skip-puppet-version-check
–foreman-client-ssl-cert=/etc/puppetlabs/puppet/ssl/certs/ec-foremantst.dci.bt.com.pem
–foreman-client-ssl-key=/etc/puppetlabs/puppet/ssl/private_keys/ec-foremantst.dci.bt.com.pem
–foreman-server-ssl-cert=/etc/puppetlabs/puppet/ssl/certs/ec-foremantst.dci.bt.com.pem
–foreman-server-ssl-key=/etc/puppetlabs/puppet/ssl/private_keys/ec-foremantst.dci.bt.com.pem
–foreman-proxy-puppet=false
–no-enable-foreman-proxy
–foreman-proxy-puppetca=false
–foreman-db-manage=false
–foreman-db-host=tpec02p7db01.dci.bt.com
–foreman-db-database=foreman
–foreman-db-username=foreman
–foreman-db-password=PA55p05t
–foreman-initial-admin-password=passw0rd
–foreman-oauth-consumer-key=DRGK7jnAexKWqL9c5BUCxmJavMmmCbqb
–foreman-oauth-consumer-secret=zhPAc3SnLUCjoBhihrcpCiDwZPhacWLL

The erroe is

2024-01-19 09:52:25 [NOTICE] [configure] Starting system configuration.
2024-01-19 09:52:38 [NOTICE] [configure] 250 configuration steps out of 664 steps complete.
2024-01-19 09:53:14 [NOTICE] [configure] 500 configuration steps out of 669 steps complete.
2024-01-19 09:53:57 [ERROR ] [configure] /Stage[main]/Foreman::Register/Foreman_host[foreman-tpec02p7for01.dci.bt.com]: Could not evaluate: Exception SSL_connect returned=1 errno=0 peeraddr=10.34.120.147:443 state=error: certificate verify failed (hostname mismatch) in get request to: https://tpec02p7for01.dci.bt.com/api/v2/hosts?search=name%3D"tpec02p7for01.dci.bt.com"
2024-01-19 09:53:57 [ERROR ] [configure] Wrapped exception:
2024-01-19 09:53:57 [ERROR ] [configure] SSL_connect returned=1 errno=0 peeraddr=10.34.120.147:443 state=error: certificate verify failed (hostname mismatch)
2024-01-19 09:53:59 [NOTICE] [configure] System configuration has finished.

Error 1: Puppet Foreman_host resource ‘foreman-tpec02p7for01.dci.bt.com’ failed. Logs:
/Stage[main]/Foreman::Register/Foreman_host[/]
Adding autorequire relationship with Anchor[foreman::service]
Adding autorequire relationship with Anchor[foreman::providers::oauth]
Starting to evaluate the resource (659 of 669)
Could not evaluate: Exception SSL_connect returned=1 errno=0 peeraddr=10.34.120.147:443 state=error: certificate verify failed (hostname mismatch) in get request to: https://tpec02p7for01.dci.bt.com/api/v2/hosts?search=name%3D"tpec02p7for01.dci.bt.com"
Wrapped exception:
SSL_connect returned=1 errno=0 peeraddr=10.34.120.147:443 state=error: certificate verify failed (hostname mismatch)
Evaluated in 0.02 seconds
Foreman_hostforeman-tpec02p7for01.dci.bt.com
Making get request to https://tpec02p7for01.dci.bt.com/api/v2/hosts?search=name%3D"tpec02p7for01.dci.bt.com"

1 error was detected during installation.
Please address the errors and re-run the installer to ensure the system is properly configured.
Failing to do so is likely to result in broken functionality.

The full log is at /var/log/foreman-installer/foreman.log

My setup consists on a separate database, separate Puppet CA server and a separate multi Foreman(s).

Is this a good idea? You stated that you

installing my first foreman instance.

I would suggest starting with one instance with default settings and slowly trying and investigating stuff, rather than jumping on setup like you described.