简体   繁体   中英

Using Openssl API to read all X509 certificates from a folder in C

In an application (in C language), I would need to attach all the CA certificates available locally. So, I'm looking for some Openssl library function that could help me to load all the certificates in X509 format from a given folder (or certificate store), for example /etc/ssl/certs directory. I would appreciate any help in this regards.

Thanks, Ankit

I'm assuming this is what you wanted: SSL_CTX_load_verify_locations() ?

I understand the OpenSSL documentation is dense, but you're going to have to be able to find what you need in it (and not via a stackoverflow question).

Make sure if you added new certificates to that directory that you re-run c_rehash, as mentioned in the documentation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM