Chef Server certificates Problem

Connecting to host 192.168.60.12:30578
ERROR: The SSL cert is signed by a trusted authority but is not valid for the given hostname
ERROR: You are attempting to connect to: '192.168.60.12'
ERROR: The server's certificate belongs to 'chef-server-1-b5ff9fff-fp2mg'

TO FIX THIS ERROR:

The solution for this issue depends on your networking configuration. If you
are able to connect to this server using the hostname chef-server-1-b5ff9fff-fp2mg
instead of 192.168.60.12, then you can resolve this issue by updating chef_server_url
in your configuration file.

If you are not able to connect to the server using the hostname chef-server-1-b5ff9fff-fp2mg
you will have to update the certificate on the server to use the correct hostname.

The problem is that i cannot access my server by hostname
What to do?

Fix your infra so naming is correct, before doing anything else that should be what to do.

As last case workaround you can edit your local hosts file so the name resolve to the ip, in windows the file has to be created under windows/etc/drivers/hosts (if I remember correctly)

Actually I am accessing chef-server from windows workstation and my chef server is hosted on a vm which i can access through ip address but it is saying i have to access it through host name.