@eugene de Fikh
If you can provide more detailed exception / error then it will help in getting this issue resolved much quicker.
Based on the error message that you posted 'Failed to retrieve the server's certificate'
It looks like ambari agents might not be able to contact ambari server. So please check if ambari Agent machines can resolve ambaris erver host aand can communicate on 8440 & 8441 ports?
Please try running the following commands from agent machine to verify if they are able to connect to ambari Server?
# telnet $AMBARI_HOSTNAME 8440
# telnet $AMBARI_HOSTNAME 8441
If not then
1. please check if agents machine can resolve ambari server hostname/FQDN? Check:
2. Please check if ambari server host has "iptables" disabled.