OpenSSL Communities

SSL certificate

engineer2024 PublicSeen by 119

I have a SSL certificate bought from a vendor for my domain. When I install this certificate on a server which is running not on the domain mentioned in the certificate, when I do openssl s_client to that server, it is showing verify as OK and handshake is a success. Now my question is, how is that certificate working, if it created for a specific domain, as in this case, the server on which it is installed does not serve under that domain name ?

Viktor Dukhovni

Don't confuse trust path verification with hostname verification. Unless you tell `s_client` to verify a specific domain name in the certification, the verification status will reflect just the authenticity of the certificate, with no specific check of the domain name.

The `-verify_hostname <some-hostname>` option of `s_client` will also check the hostname. If you also use `-verify_return_error` it will abort the connection when verification fails.