What an SSL/TLS certificate proves
A certificate ties a public key to one or more hostnames and is signed by a certificate authority. When a browser connects, it checks that the name matches, the dates are valid and the signature traces back to a root it trusts. A valid certificate means the connection is encrypted to the right host. It does not mean the site is safe or legitimate, because attackers can obtain valid certificates for their own domains.