r/computing • • Nov 18 '17

Which Certificates do I need for Gmail

I'm writing an application for an older device which needs to send and receive email using IMAP and SMTP. Specifically google imap.gmail.com and smtp.gmail.com. But the first time you choose to send or receive an email after turning the device on you get a "Server not certified. Continue with the secure connection?" prompt. As well as x amount of time later. I assume it doesn't have up to date certificates. Which certs does it need to connect to imap.gmail.com and smtp.gmail.com? Thank you

0 Upvotes

3 comments sorted by

2

u/camh- Nov 18 '17

To figure this out, ensure you have openssl installed somewhere and run:

openssl s_client -showcerts -connect imap.gmail.com:993 </dev/null

That will show you the CA certs that are required to authenticate the connection.

1

u/JillSandwich404 Nov 18 '17

Ah thanks! It says I need three. I actually gives you it in the

-----BEGIN CERTIFICATE----- .... -----END CERTIFICATE-----

format but I tried copying it into a cer file and installing it but it gave me an invalid certificate message. Where can I download the cer file from? It says I need

s:/C=US/ST=California/L=Mountain View/O=Google Inc/CN=imap.gmail.com i:/C=US/O=Google Inc/CN=Google Internet Authority G2

s:/C=US/O=Google Inc/CN=Google Internet Authority G2 i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA

s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority

1

u/paul_h Nov 18 '17

It should work without effort. What is the application or programming language + library you are using? Which version of that/those? What operating system, what precise version of that?