Download a certificate from a web page via CLI
I wanted to get the certificate from a Kubernetes API server, so I thought to download it from the https page, but then I had to use in a server without Desktop Environment and I didn't want to bother copying it with scp, so I searched a way to do it all from bash.
This is what I found:
openssl s_client \
-showcerts \
-connect server.edu:443 </dev/null 2>/dev/null|openssl x509 \
-outform PEM > mycertfile.pem