openssl s_client -showcerts -connect google.de:443 </dev/null
Gets a text representation that you can convert / undo as you wish. It can output more than one certificate (and it also outputs part of the data stream), but it works anyway. Very useful if the certificates are not otherwise offered in an obvious way by authority.
source share