OpenSSL 3 · Inspecting TLS servers
Inspect a server's certificate
Connect to a server and print its certificate chain. -servername sets SNI, which many hosts need.
openssl s_client -connect example.com:443 -servername example.com -showcerts </dev/null
Official OpenSSL 3 documentation