4

Tip: Retrieving server certificate used in SSL communication (e.g. POP3s)

 2 years ago
source link: https://blog.jakubholy.net/2010/10/21/tip-retrieving-server-certificate-used-in-ssl-communication-e-g-pop3s/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Tip: Retrieving server certificate used in SSL communication (e.g. POP3s)

October 21, 2010
If you would like to get the security certificate used by a server in communication over SSL, such as with the HTTPS or POP3s protocols, for instance to install it on a client device that needs to talk to the server, you can use OpenSSL to retrieve it:


bash$ openssl s_client -connect pop.gmail.com:995 -showcerts



You then store the text starting with "-----BEGIN CERTIFICATE-----" and ending with "-----END CERTIFICATE-----" (inclusive) into a file with the extension .pem.

You can also use openssl to convert the certificate into another format, e.g.:


bash$ openssl x509 -in mycertificate.pem -inform PEM -out mycertificate.der -outform DER



The information originates from the page Gmail POP3 with Fetchmail where you can find a more detailed description and also instructions for testing the certificate.
Tags: security

Are you benefitting from my writing? Consider buying me a coffee or supporting my work via GitHub Sponsors. Thank you! You can also book me for a mentoring / pair-programming session via Codementor or (cheaper) email.

Allow me to write to you!

Let's get in touch! I will occasionally send you a short email with a few links to interesting stuff I found and with summaries of my new blog posts. Max 1-2 emails per month. I read and answer to all replies.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK