How to find gmail certificate for libcurl?

I'm following this libcurl example here to send an email:

https://github.com/curl/curl/blob/master/docs/examples/smtp-tls.c

I mostly got it to work, but I'm having trouble with this line here:

curl_easy_setopt(curl, CURLOPT_CAINFO, "/path/to/certificate.pem");

I was able to get around it by adding the two lines of code suggested:

1
2
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);


Which is nice for verifying it works, but as said by the example, is a bad idea overall, especially since Gmail is sure to have a valid certificate. That said, I've googled for it and can't same to find anything that matches what I'm looking for. Does anyone know where I could find the path to Gmail's certificate? Thanks!
Last edited on
Topic archived. No new replies allowed.