Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static CURLcode SSLCTX_Callback(CURL *curl, void *ssl_ctx, void *user)
- {
- X509_STORE *store;
- X509 *cert = NULL;
- BIO *bio;
- STACK_OF(X509_INFO) *inf;
- X509_INFO *itmp;
- int i;
- store = SSL_CTX_get_cert_store((SSL_CTX *)ssl_ctx);
- bio = BIO_new_mem_buf(MY_ACCEPTED_PEM, -1);
- inf = PEM_X509_INFO_read_bio(bio, NULL, NULL, "");
- BIO_free(bio);
- if (inf)
- {
- for (i = 0; i < sk_X509_INFO_num(inf); i++)
- {
- itmp = sk_X509_INFO_value(inf, i);
- if (itmp->x509)
- X509_STORE_add_cert(store, itmp->x509);
- }
- }
- sk_X509_INFO_pop_free(inf, X509_INFO_free);
- return CURLE_OK;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement