Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of defaultCertificateVerifier #243

Open
jjohnson-airlink opened this issue Aug 26, 2020 · 3 comments
Open

Example of defaultCertificateVerifier #243

jjohnson-airlink opened this issue Aug 26, 2020 · 3 comments

Comments

@jjohnson-airlink
Copy link

Is it possible to get a better example of using defaultCertificateVerifier?
example6.cpp only uses the version that accepts user input.
Thanks!

@josusky
Copy link
Contributor

josusky commented Aug 27, 2020

I load trusted certificates into a vector of vmime::shared_ptrvmime::security::cert::X509Certificate and then pass it to a default verifier:
auto defaultVerifier = vmime::make_sharedvmime::security::cert::defaultCertificateVerifier();
defaultVerifier->setX509RootCAs(trustedCACerts);
finally I pass the verifier to the transport:
transport->setCertificateVerifier(defaultVerifier);
that is it.

@jjohnson-airlink
Copy link
Author

Thanks josusky
would you be willing to post the entire set of code for that part?
I assume you are on version 0.9.2. Do you know if this part even works in version 0.9.1?
Thanks!

@vincent-richard
Copy link
Member

The full example is in the documentation (the VMime book): 6.7.3.2 "Using the default certificate verifier". Available since a few years, so should be ok in 0.9.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants